PHP Simplicity Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

I am not always around so I might be late on replying.

Author Topic: encripted filename  (Read 2015 times)

0 Members and 1 Guest are viewing this topic.

naza

  • Guest
encripted filename
« on: May 26, 2006, 10:58:07 AM »

can u encripted filename like flatFileHost http://www.j-fx.ws/ffh/ ? flatFileHost no longer update.
so somefile.mp3 become 78df895e456544
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: encripted filename
« Reply #1 on: May 27, 2006, 05:48:26 AM »

it can be done. just specify the encryption algorithem you want.
in upload.php, look for:
Code: [Select]
$fullname = SFU_REALPATH.$File;
add before: (encryption type here)
Code: [Select]
$File = md5($File . time()); // I used MD5 encryption and added time() to make sure no files with the same name will collesion
this will produce a 32-bit long filename..
Logged

We don't need a reason to help people

naza

  • Guest
Re: encripted filename
« Reply #2 on: May 28, 2006, 02:19:08 PM »

it work. the problem is how to download the file ? download.php canot see this file ! how to download original file name ?
Logged

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: encripted filename
« Reply #3 on: May 28, 2006, 02:55:27 PM »

hmm...
in download.php change this:
Downloads('.'truetrue);

to this:
Downloads('.'falsetrue);

but either way, you will not be able to tell what was the original name of the file unless you store it some where else which is really a long story.
Logged

We don't need a reason to help people

Jan

  • Guest
Re: encripted filename
« Reply #4 on: September 28, 2010, 02:10:06 PM »

At First .. Great Script

but ...

$File = md5($File . time()); // I used MD5 encryption and added time() to make sure no files with the same name will collesion

and what is with the extension ??

now i have a picture like aaaaaaaaaaaaaaaaaaaaaa3333333332g3edsdsd and thats it

but the picture must be aaaaaaaaaaaaaaaaaaaaaa3333333332g3edsdsd.jpg .... or not ??  ;)

I'm not a coder !!

I'm a copy&paster  ;D

Logged

Jan

  • Guest
Re: encripted filename
« Reply #5 on: September 28, 2010, 03:01:01 PM »

ok now i made it so

Code: [Select]
$File = md5($File .  time()).$noext.$ext; // I used MD5 encryption and added time() to make sure no files with the same name will collesion
$noext give my the point (.) and $ext the extension jpg



Logged
 

+ Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.
Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What is the answer to one plus one? (in numbers):