This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 4

Unable to upload file


  1. krishna
    Member

    Hello,

    I am not able to upload files into.
    Please follow the link http://nriva.org/machform/view.php?id=13147 to test.

    Thanks

    Posted 10 years ago #
  2. AMurray
    Pro Member

    For your test form you don't have any user guideline saying what file type is allowed, so I took a guess, and it didn't work for *.txt.

    I am guessing you haven't yet configured what file types you want to allow as uploads.

    Do that in the form editor field properties, for the upload field you can see there is an option for allowed or disallowed file types - i.e. list the file extensions in "allowed" - so for example, put these in the "allowed" list as below: separate each by a comma:

    doc,docx,pdf,txt,jpeg,jpg,png,gif

    Anything else is not allowed (particularly important to block any file that could have malicious code, or trojan/virus etc).

    In the Upload field properties, you can set the files types allowed (or not allowed).

    Please try this solution, and if not working post back.

    Posted 10 years ago #
  3. krishna
    Member

    Thanks for the reply, actually i did, it was allowing only jpg, jpeg, bmp and now i added txt and added help text for the field with the configurations i made. I even tried to tweak the code a bit to add some debug statements but it did not help me, it was in the upload.php, the error i am seeing with the debug statement is "Unable to move file!"

    I am new to php, but is there a way to see logs or anything in php or machforms? I am a developer myself and feeling lost with out that.

    Thanks,
    Krishna

    Posted 10 years ago #
  4. AMurray
    Pro Member

    I saw the change to the example form, and yes, still an issue ("unable to upload file").

    I'm no expert with PHP but some suggestions:

    Log files are something your host would help with. The error log could be located within your web space (either in the public_html or a level about the root folder, I'm not sure). Something like php.log, possibly you can access it from your control panel (Plesk, cPanel or similar) file manager, or an FTP application.

    Not sure what "unable to move file" means, but possibly another way of saying the folder is not writable i.,e. needs correct permissions e.g. CHMOD 755 or whatever is appropriate. Could also be a problem with your host.

    Could be it is a limit set by your host in the php.ini file e.g. file upload limit or execution time or a time-out setting. They are settings in php.ini that are either controlled by your host, or need to be set in a local php.ini file depending on what your host allows you to do.

    If you can locate the log file (with assistance from your host) perhaps then log a help request with Appnitro directly as they don't monitor this forum full-time, but are active in responding to email help requests, if it appears the issue is directly related to Machform, and not a result of restriction set by your hosting service.

    http://www.appnitro.com/contact

    Posted 10 years ago #
  5. krishna
    Member

    Thank you.

    There we couple of issues i had to fix to get this working.
    1) fix the log files to see what the error and the error it had was
    [Fri Jun 13 14:50:28 2014] [12448459] [fcgid:warn] mod_fcgid: stderr: PHP Warning: File upload error - unable to create a temporary file in Unknown on line 0, referer http://nriva.org/machform/view.php?id=13147

    2) The above error made me the think that there might be a temporary file being created in the process and its not happening due to some settings.
    Then i ran the php info and saw that there is a setting for temporary file upload location and its not pointed out to what i wanted it to be and so made changes to the setting upload_tmp_dir

    And after this i the upload is working.

    Thanks for the help!

    Krishna.

    Posted 10 years ago #

RSS feed for this topic

Reply