Jump to content

Recommended Posts

Greeting guys

 

In my attempt not to forget php I am playing around with an idea of creating a multiuser gallery, where people can post images and view them.

 

If you think that something can be done in a better way or maybe there are better practices of doing something similar out there I'd appreciate your advice.

 

Here's how I see it done:

 

*Every user will have a separate directory to save files(images). That means every time a user registers a directory is created with a name that matches the user's username. if auser is deleted, than the directory is deleted along with it's content.

 

*Every time user uploads an image, it will be stored in user directory with a name like: 2007-03-12-23-43-11.jpg (to make sure user cant oveerwrite a file. the real filename will be stored in the database. Every time user uploads an image a thumbnail will be created on the server and saved in user folder along with the original image with the prefix "thumb-", example: thumb-2007-03-12-23-43-11.jpg.

 

*when user will browse the images the thumbnails will be displaied. whne clickedon the thumbnail the large original image will be loaded.

 

 

Do you think this is the right way to head to? Any suggestins? Ideas?

 

Thank you for reading through. Would appreciate your contribution

*Every user will have a separate directory to save files(images). That means every time a user registers a directory is created with a name that matches the user's username. if auser is deleted, than the directory is deleted along with it's content.

 

I really don't know what the best way of doing this is, but here is how I would go about it.

 

Just make a SINGLE folder for ALL uploaded images to go into. The filename to each image uploaded will be stored in the database, along with which user uploaded it. To display an image from the database, you just simply have to type out the path to the folder the images is stored in, then tack on the filename to the end from the DB.

 

I just see this method easier because it will be much easier to keep track and pull information from. Then again, I have no idea which way is better....we will leave that to one of the PHP gurus to answer.

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.