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

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Problem with File Upload


  1. albannach
    Member

    Hi Guys,

    Having a slight problem with the file upload function, it worked when I first designed the form... the only thing I changed was that I edited the form in MySQL, changed form_has_css from 1 to 0, because the Machform generated CSS was conflicting with my site's CSS.

    Now when I fill in the form, it uploads the file (i know it doing it as it takes a while), but then it seems to discard it, the review form shows no filename uploaded, and there's nothing in the upload directory.

    Have checked settings:

    The type of file is allowed.
    PHP.ini is set-up correctly (can upload upto 1GB)
    upload folder is in CGI-BIN, with permissions: drwxr-xr-x

    Found this in my error logs:

    [Sun Sep 20 08:14:20 2009] [error] [client 86.10.98.237] PHP Warning: move_uploaded_file(/var/www/html/contact//var/www/cgi-bin/upload/form_6/files/element_10_78e79844c6c03323785edb073d18fe51-6-video_woopass.mpg.tmp) [function.move-uploaded-file]: failed to open stream: No such file or directory in /var/www/html/contact/includes/post-functions.php on line 1041, referer: http://www.albannachmusic.com/contact/video.php
    [Sun Sep 20 08:14:20 2009] [error] [client 86.10.98.237] PHP Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php2TU40j' to '/var/www/html/contact//var/www/cgi-bin/upload/form_6/files/element_10_78e79844c6c03323785edb073d18fe51-6-video_woopass.mpg.tmp' in /var/www/html/contact/includes/post-functions.php on line 1041, referer: http://www.albannachmusic.com/contact/video.php

    Any ideas ?

    Thanks for any assistance you can provide.

    Chris.

    Posted 15 years ago #
  2. albannach
    Member

    Oh, Here's the access log from that upload attempt:

    86.10.98.237 - - [20/Sep/2009:08:12:40 -0500] "GET /contact/video.php HTTP/1.1" 200 11695 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)"

    86.10.98.237 - - [20/Sep/2009:08:13:24 -0500] "POST /contact/video.php HTTP/1.1" 200 1820 "http://www.albannachmusic.com/contact/video.php" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)"

    86.10.98.237 - - [20/Sep/2009:08:14:20 -0500] "GET /contact/video.php?show_review=1 HTTP/1.1" 200 6485 "http://www.albannachmusic.com/contact/video.php" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)"

    Posted 15 years ago #
  3. yuniar

    So, previously the upload worked fine?

    To test, try to create another new form with just one file upload field.
    Then upload a small file (less than 1MB) to test it.

    If that doesn't work, try to restore your data folder to the original "machform/data" folder.

    If everything seems to be failed, please contact us directly and let us know temporary FTP login to your machform. We'll help you fixing it.


    MachForm Founder

    Posted 15 years ago #
  4. albannach
    Member

    Hi,

    I managed to fix it, it seems I must have changed the upload path in config.php

    I just noticed:

    /var/www/html/contact//var/www/cgi-bin/upload/form_6/files/element_10_78e79844c6c03323785edb073d18fe51-6-video_woopass.mpg.tmp

    .. is not a valid path.

    in config.php I had var/www/cgi-bin/upload/
    I changed it to ../../cgi-bin/upload/

    And now it works fine.

    Thanks :-)

    Posted 15 years ago #

RSS feed for this topic

Reply