Jump to content

File copying help


diar33

Recommended Posts

Here's teh situation: Members of the site are allowed to post photos, which are stored in randomly named directories. The server the site's on wont allow for much security, so in the case that someone finds the folder name, they will be able to see that members photos even if not a member of the site. To fix that, there is an index file in each directory which throws them back to the site's index. However, it goes to a bad link, actually another site I did the same thing for.. which is bad.
Link to comment
https://forums.phpfreaks.com/topic/16377-file-copying-help/#findComment-68324
Share on other sites

Those wouldn't work, as the host doesn't allow .htaccess, and the members are allowed to have multiple photos, though it could still be done this way I suppose.

Either way, I still need a way to change what's currently there, as there are over 300 members with pictures and going through each and changing it is a complete nightmare. The site is live and I couldn't just go and delete everyone's current pictures.

Thanks for the replies,

TValdes
Link to comment
https://forums.phpfreaks.com/topic/16377-file-copying-help/#findComment-68343
Share on other sites

What I do on these
Get the Unique User ID number
Get a DateStamp
I normally only have one upload as its for profiles so this will do for me
[code=php:0]
$user_id = $id; //This is the users unique ID
$stamp = date("Y-m-d H:i:s");
$new_file_name = $id."_".$date.".".$ext
[/code]

The name is always unique, this stops against accidently overwriting.
//I Normally get the file ext, to check it is jpg || gif..... That is what the $ext is

Link to comment
https://forums.phpfreaks.com/topic/16377-file-copying-help/#findComment-68430
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.