Using files array in another page ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smartic
    New Member
    • May 2007
    • 150

    Using files array in another page ?

    in my site I'm having gallery page that you can upload your pictures in steps first step you upload the picture then go to another page, my problem is i want to use this file that have been uploaded in temp folder in the second page because in the finale step i will upload it in database ,how can i do that?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    I'm not sure you can pass around file data.

    Why not just upload it in the first page, then pass the url with a session through the rest of the pages?

    Comment

    • smartic
      New Member
      • May 2007
      • 150

      #3
      what if i saved the binary date of the file in the session for it and use it for another page is that ok or not?

      Comment

      • nashruddin
        New Member
        • Jun 2008
        • 25

        #4
        why don't you switch the steps? the steps:
        1. user enter his info
        2. user upload his photo
        3. save all data to database

        then you don't have to read $_FILES from previous page.

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          Could you not simply upload the image to the database in step one?
          Why wait till step three?

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by Atli
            Could you not simply upload the image to the database in step one?
            Why wait till step three?
            We think alike.
            ;]

            Comment

            • pbmods
              Recognized Expert Expert
              • Apr 2007
              • 5821

              #7
              Heya, Smartic.

              An alternative would be to move the file to a secondary location on your server (you can't rely on its location in the temp directory, since it could be erased).

              The only problem is that you then are going to want to have some sort of garbage collection routine (to remove "step 1" uploads that never made it to step 3).

              Comment

              Working...