Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Cool hold on the with upload

    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
    Code:
    request.form
    request.querystring
    Upload.form
    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?

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts

    i mean

    we got
    Code:
    <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...

  • #3
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    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?

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts

    hey miranda:)

    well i'm building 4 steps\pages registery...
    and i want that the files will be chosen by
    Code:
    <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"...
    i tried
    Code:
    <INPUT TYPE=FILE SIZE=40 NAME="FILE1" value="c:\dir\img.jpg"
    not good...

  • #5
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question Set File1 = Upload.Files("FILE1")

    i need somehow to save it in some varibale to carry to the next page...
    Code:
    Set File1 = Upload.Files("FILE1")

  • #6
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    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?

  • #7
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts

    but i do

    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.

  • #8
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    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.

  • #9
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    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.

  • #10
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    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.

  • #11
    Regular Coder
    Join Date
    Sep 2007
    Posts
    179
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question to pass hidden value how?

    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?
    Last edited by sasha85; 09-25-2007 at 08:10 AM.


  •  

    Posting Permissions

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