View Full Version : hold on the with upload
09-23-2007, 06:50 PM
imagine 3 pages...
on the first you collect 2 variable
(for example name and last name, in forms field ofcourse)
on the second page you show the 2 variables from the first page
and collect 2 more variables(for example address and phone number,in forms field too)
and on the 3 page all the data being saved into some database (say sql)
well this is all simple cause we got the basic commands
but when the case comes to uploading...
how can i choose a file at the beggining - on the first page (with the browse button)
and carry it with me to the second page, and from there to the 3th page ,where it will be uploaded?
09-23-2007, 08:52 PM
<INPUT TYPE=FILE SIZE=40 NAME="FILE1">
is there a way to control value?
or order "name" and to save it in temp dim before uploading, so we could upload it later...:confused:
09-23-2007, 09:01 PM
I have never seen anyone try to do that nor do I think it would be possible. You could upload the item to your server, perhaps set up a temp folder to hold these, then pass that information on to the next page where you can then change the location or file name as you see fit.
Really though why would you want to do something like this?
09-23-2007, 09:20 PM
well i'm building 4 steps\pages registery...
and i want that the files will be chosen by
<INPUT TYPE=FILE SIZE=40 NAME="FILE1">
at the second page...
and it is realy logic to somehow let the user pick his files on the second page and to upload them only in the end of the registery.
your suggestion is good but not so short and simple...it's like going circles;)
there is got to be a way to mange the "value" and "name"...
<INPUT TYPE=FILE SIZE=40 NAME="FILE1" value="c:\dir\img.jpg"
09-23-2007, 10:39 PM
i need somehow to save it in some varibale to carry to the next page...
Set File1 = Upload.Files("FILE1")
09-24-2007, 05:02 AM
An uploaded file is not the same as some text. text can be put into a variable and then passed as a hidden form element from page to page. You cannot just pass an uploaded file as a hidden form element. It doesn't work that way. Why do you want to wait until the end to save everything? If you have toi wait until you have all of the data why not wait until the last page to do the upload?
09-24-2007, 08:35 AM
i do need to upload the files only on the end...when everything is ok...
but the user choose the files in the middle of the procces.
about the upload...i know that the file is not string or char and that we are not looking on it as a text...but the thing is that i need a way to save the location of the original file on user's pc and to save this location as string
(for example C:\dir\miranda.txt)
and on the end somehow to use some command for uploading from this location.:rolleyes:
09-24-2007, 09:01 AM
This isn't possible, and for a good reason. Imagine if you could just put some code on your website that would upload any file from a user's computer. Their documents, passwords, cookies, etc.
You can upload the file at the beginning, and delete it later with a cron job(or scheduled task, or some code that executes on each pageload) if the registration isn't finished.
09-24-2007, 08:13 PM
That is why I say to make a temp folder and save the file there. Then if everything checks out you can move the file from the temp folder to the correct location, if it doesn't check out you can delete it at that time. And if you need to you can also change the name of the file at this time.
As to holding the file in a variable it just cannot be done.
09-24-2007, 08:33 PM
Why don't you just pass the path of the item as a hidden value and in the end upload it using this path?
I think it could be arranged.
09-25-2007, 07:52 AM
i need to upload my files from the first form and then keep passing the destination path (obtained from File.Path) as a hidden variable to all other forms
but the BIG Question is how to do this?
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.