Jump to content

How can i make folders with auto incrementing int names?


AEllerbrock

Recommended Posts

I'm building a website in which the user can upload 3 photos of the same product (from different angles). what i want is that the user only selects those 3 iamges, writes a description and when they press upload the system creates an album named "1" with the 3 images in it. the next time the new folder name will be "2"

 

I tried storing them on a mysql database but i read it makes it too heavy and the queries take longer. so i'll just save the path there. thanks!

Link to comment
Share on other sites

Does the client Log In?

 

I would suggest that you create a folder for each client in your image folder.  Then create a new unique name for the image (be careful of collisions).  Maybe a random string, then hashed.  Insert the file name into the database, tying it back to the user's table. 

 

If you put 3 images into each folder, that would create a mess of folders, I would keep them all in one.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.