Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

file upload on multi-step form


Robert Poole

8:54 am on Apr 30, 2008 (gmt 0)

5+ Year Member

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.


9:18 am on Apr 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

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 !


Robert Poole

10:07 am on Apr 30, 2008 (gmt 0)

5+ Year Member

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.


2:34 pm on Apr 30, 2008 (gmt 0)

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

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.


Robert Poole

2:50 pm on Apr 30, 2008 (gmt 0)

5+ Year Member

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?

Featured Threads

Hot Threads This Week

Hot Threads This Month