Jump to content


Photo

[SOLVED] file privacy


  • Please log in to reply
4 replies to this topic

#1 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 16 May 2006 - 02:05 PM

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

#2 haydndup

haydndup
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts
  • LocationJohannesburg, South Africa

Posted 16 May 2006 - 02:22 PM

[!--quoteo(post=374278:date=May 16 2006, 04:05 PM:name=Richard181)--][div class=\'quotetop\']QUOTE(Richard181 @ May 16 2006, 04:05 PM) View Post[/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.
[!--coloro:#660000--][span style="color:#660000"][!--/coloro--]The Gene Pool Could Use A Little Chlorine[!--colorc--][/span][!--/colorc--]

#3 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 16 May 2006 - 04:35 PM

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;


#4 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 16 May 2006 - 05:07 PM

are you going to store the new filenames into the db? maybe you can change the filename into USERID.PIC#
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#5 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 16 May 2006 - 05:35 PM

[!--quoteo(post=374343:date=May 16 2006, 01:07 PM:name=ryanlwh)--][div class=\'quotetop\']QUOTE(ryanlwh @ May 16 2006, 01:07 PM) View Post[/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..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users