SitePoint Sponsor

User Tag List

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

    passing $_FILES from one page to the next

    Hi

    With regards to files in forms. Can $_FILES be passed like any other array from one page to the next in hidden form inputs before it is processed? What happens to the tmp file that is created on the server? Is it still there if I carry the array or do i need to create a new tmp file - if so how???

    my files array is passing but the tmp file seems to disappear??? any help appreciated because i can't find any specific info on this but there must be a way around it.

    a+
    gar

  2. #2
    SitePoint Addict Ramiro S's Avatar
    Join Date
    May 2003
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, the file remains in the tmp folder....

    You can use sessions to keep the content of $_FILES through the pages.
    Quasar - Web Development - Free Avatars

  3. #3
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mmm an is_uploaded_file(); on the tmp file name produces a positive result on the first page but a negative one on the second page. ultimately sessions isn't the way i want to go for this but its worth testing if the sessions will carry my $_FILES becase the hidden input doesn't seem to be - i'll test this.

    a+
    gar

  4. #4
    SitePoint Addict Garrett's Avatar
    Join Date
    Feb 2001
    Location
    England
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ramiro S
    Yes, the file remains in the tmp folder....

    You can use sessions to keep the content of $_FILES through the pages.
    i just rethought this and what i said is nonsense, the array of $_FILES is passing - no problems there but the actually file, the tmp file in /var/tmp/, disappears on the second page of the form. so it makes no difference whether i use a hidden input or sessions thats just technique - what i need to refind is the tmp file or how its referenced beacause the $_FILES['object']['tmp_name'] ('object being the file inputs original name) seems to hold no reference to the file. a direct test of the tmp file with file_exists() returns nothing on the second page so ether its name changes in some way or it must not exist.

    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
  •