SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    file upload preview page

    Hi

    Trying to write a form with a file upload page which has a preview option on it. Basically you fill in a form attach a file and ether preview or post. The post works fine but if the preview is choosen it passes all the form variables to a page with lots of hidden inputs to carry the variables onto the final post page. Everything works except the attached file upload which i'm passing on like so...

    <input type="hidden" name="files" value="<? $files = urlencode(serialize($_FILES)); echo $files; ?>" />

    I can see it on the final page but when i try to move_uploaded_file() it doesn't act like a file - is there an issue with storing the $_FILES variable (under a new name $files), does the file get flushed out of its temporary storage????

    a+
    gar

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    make sure your form tag has a enctype="multipart/form-data" attribute or nothing will get uploaded.
    Aaron Brazell
    Technosailor



  3. #3
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yep thats there. I would post the code but it very very long.

    a+
    gar


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •