Hello everyone, I'm still new to php and html, I'm creating an upload page where I use dreamweaver to create a multi form to upload multiple Images.

The page I'm working on has 6 images. I currently have it so when the user hits submit, it uploads the image into my ftp's images folder and renames it to 1_image1.jpg.

I need to have the images in a named scheme such as 1_image1.jpg, 1_image2.jpg, 1_image3.jpg, 1_image4.jpg etc..

I was wondering if there was a way to have dreamweaver name it, (between the form tags), so when it arrives in my ftp folder, it's already named, and I wouldn't have to code php to change the name.

Thanks a lot for any help

    Just wanted to add, I'm creating a dynamic website, where the user has a template that they login to where they can insert text and images, and a different login for viewers to view the site.

    So when they hit the submit button, the images are sent into my Images folder instead of a database. On the viewer's page, I just put in the URL for the image and resize it.

    The problem with my page now is that it can't differentiate between images. Like I have 6 uploads on the edit page, when they editor hits submit from any upload, I have it so that I use php to change the name to 1_image1.jpg. But they could hit submit on any of the uploads and my php code just names it to 1_image1.jpg. It can't tell that there's a difference in each upload.

    I can't seem to figure out how to have each upload on the edit page be unique.

    Like I want to be able to code the php so it's like this in pseudocode:

    if (image = 1) {
    assign name image1.jpg to that image}

    elseif (image = 2) {
    assign name image2.jpg to that image}

    etc..

    Thanks again for any help

      The only thing I can think of is name the file using hidden form fields but that would make it the same each time and would overwrite the old version unless the directory it was stored in was dependent on another field.

      PHP is the only way to do this using move_uploaded_file

        Hmm ok thanks ClarkF1,

        I'm going to play around with the code some more, see if I can do anything, but any other suggestions or help would be appreciated, thanks again.

        I'll be posting here again if I make any progress.

          Eh, no progress as of yet, question though,

          Using move_uploaded_file, is it possible to change the name of each file according to which upload it came from?

          Example: 1st upload box --> PHP --> take image from tmp and name it --> Image1.jpg

                       2nd upload box --> PHP --> take image form tmp and name it --> Image2.jpg

          Like, whatever they upload in these boxes will be renamed Image followed by the box number and extension, so I would have a total of 6 images corresponding to the 6 upload boxes.

          so all the Image names are basically the same other then the number, I'm just trying to figure out how to do this anyway I can at this point.

          Thanks again for all the help

          I can't figure it out

            Write a Reply...