homepage Welcome to WebmasterWorld Guest from 54.145.183.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
file upload on multi-step form
Robert Poole

5+ Year Member



 
Msg#: 3638312 posted 8:54 am on Apr 30, 2008 (gmt 0)

I'm trying to create a form with a file upload which isn't the hard part, but after the first page is submitted I want to put in confirmation before then executing a mysql insert and the file upload in what would be a third step.

The problem I have is after the user selects the file for upload in step 1 and I've got this is step 2, how do I then carry this over to step 3?

With the rest of my details I'm using hidden form fields, but how do I get the file for upload from step 1 to step 3?

Any help or ideas would be appreciated.

 

tomda

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3638312 posted 9:18 am on Apr 30, 2008 (gmt 0)

A/ Upload the pic in a temp directory
B/ Display the thumbnail of the pic next to the form where user can enter title, date and description
C/ Upload the pic into your final directory and thumbnail directory, delete the one in your temp directory.
D/ If successfully done, update the database.

Although I don't usually drop source code to stranger :) but I just made an exemplified version for someone else, so if you also want to see it, PM me.

The three step are all written in the same file (therefore same URL) and use an upload_pic class... Works like a charm !

Tomda

Robert Poole

5+ Year Member



 
Msg#: 3638312 posted 10:07 am on Apr 30, 2008 (gmt 0)

Thanks for this but I'm not sure it's exactly what I'm looking for.

I'm really just interested in a "bridging" method to pass the file information forward one step through the form before running the upload script in a third step; maybe something equivalent to a hidden file to just a way passing the image information so it can be uploaded later.

dreamcatcher

WebmasterWorld Senior Member dreamcatcher us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3638312 posted 2:34 pm on Apr 30, 2008 (gmt 0)

You can store relevant data in sessions if you want to and access the session vars you need on each page and then process all at the end. The benefits of sessions are good if you have an instance where you need people to go back to previous pages.

dc

Robert Poole

5+ Year Member



 
Msg#: 3638312 posted 2:50 pm on Apr 30, 2008 (gmt 0)

sounds like a distinct possible, so what would i need to put in the session? just the file name and/or temp file name, and/or other stuff?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved