Upload System

Started on the old forum in July 2008 · view the original in the archive · old links redirect here

5 replies · 814 views · started 18 years ago · 1 min read

SpiderWap Lead · 622 posts #1

Ok

This time i need some advice. I'm deleting all members directories cause now i'm using wildcard dns.

Now, with the user files i'm only gana use one directory, and mysql download system.

I want to upload the files, and sort of get the extention, example .mp3 and rename the rest of the file before the .mp3 with md5 and only keep the real filename in database.

Only example... Say now i'm a user, and i upload a file to the directory: I_beg_your_poden.mp3 then it must rename that file in md5 564ffe65454c24f4489ea54d.mp3

I want to do this for security isues...

If someone could maybe help me out with some source.

Guest #3

I know my renaming will look something like this

rename("Oldname",md5("Newname."));

But how do i get the file extention

Easy, use array_reverse at the varable then explode . and ur good to go

Guest #5

Maybe an example?

havnt test it should work tho, try it

<? $link="file.mp3";
$ext=array_reverse($link);
$exp=explode(".", $ext); //$exp[0] would be like mp3  ?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close