corillo181 Posted May 16, 2006 Share Posted May 16, 2006 lets say i have a folder for ppl to upload picture and then be able to view only their pictures..but you know when you look at a picture url it gives out where the picture is located and if the user remove the photo name they go derectly to the directory and are able to see all the pictures in it.. how can this be aviod..and if is pissible how do i change the name of the file been uploaded.. i traid rand()=num.$name.. but this only adds the amount of numbe ri want to the file and keeps the same name.. i want to change the whole name..thanx for any one who help me with this.. Quote Link to comment Share on other sites More sharing options...
haydndup Posted May 16, 2006 Share Posted May 16, 2006 [!--quoteo(post=374278:date=May 16 2006, 04:05 PM:name=Richard181)--][div class=\'quotetop\']QUOTE(Richard181 @ May 16 2006, 04:05 PM) [snapback]374278[/snapback][/div][div class=\'quotemain\'][!--quotec--]but you know when you look at a picture url it gives out where the picture is located and if the user remove the photo name they go derectly to the directory and are able to see all the pictures in it.. how can this be aviod..[/quote]add a index.php file. this file can be blank, or can redirect a user to your home page. That way, users can't get the contents of a directory, because the php file gets executed. Quote Link to comment Share on other sites More sharing options...
corillo181 Posted May 16, 2006 Author Share Posted May 16, 2006 nice :) and do you know how can i change a file entried name for uploading..this only add to it..$filename = $_FILES['ulfile']['name'];$random=rand(0000,9999);$newname=$random.$filename; Quote Link to comment Share on other sites More sharing options...
ryanlwh Posted May 16, 2006 Share Posted May 16, 2006 are you going to store the new filenames into the db? maybe you can change the filename into USERID.PIC# Quote Link to comment Share on other sites More sharing options...
corillo181 Posted May 16, 2006 Author Share Posted May 16, 2006 [!--quoteo(post=374343:date=May 16 2006, 01:07 PM:name=ryanlwh)--][div class=\'quotetop\']QUOTE(ryanlwh @ May 16 2006, 01:07 PM) [snapback]374343[/snapback][/div][div class=\'quotemain\'][!--quotec--]are you going to store the new filenames into the db? maybe you can change the filename into USERID.PIC#[/quote]yes it is both going to a database and a directory.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.