Jump to content

Is There A Way To Change A Link?


Mancent

Recommended Posts

Say you have this url link as

http://wiistream.com/users/100001957015772/sounds/028d18dfa174315ef5dca7c006b815fd.wss

 

and you want to make a download button to download this link as a file;

and the file name would be the name of the file with the correct ext.

 

so it would be somthing like this

 

Eminem - Mockingbird.mp3

 

 

how could I do that. I can select all the data like the name, and the file, and make the button, to call the script, but how do i do it so it's a download, and also change the data back to what it was.

 

from 028d18dfa174315ef5dca7c006b815fd.wss

to Eminem - Mockingbird.mp3

 

 

so here is the mysql table data that i can collect

 

100002957030150 Eminem - Mockingbird http://wiistream.com/users/100001957015772/sounds/3fdc92b5c44a29d9d24f71e791663a3f.wss 1 1

 

UserId,SongName,SongUrl,count,protection

 

so i can collect the songname and the other data and the location of the file with the link,

Edited by Mancent
Link to comment
Share on other sites

I basically need a script that will download a URL link instead of going to the link, it works as a download.

 

once i understand that part of the code.

Ill have the download part that downloads this url That's the mp3 http://wiistream.com/users/100001957015772/sounds/3fdc92b5c44a29d9d24f71e791663a3f.wss

 

Then I guess We would strip the http://wiistream.com/users/100001957015772/sounds/

 

and only keep the file name itself 3fdc92b5c44a29d9d24f71e791663a3f.wss

 

or maybe not.

and i basically want to rename this file 3fdc92b5c44a29d9d24f71e791663a3f.wss

before the download starts it has to convert this 3fdc92b5c44a29d9d24f71e791663a3f.wss from this 3fdc92b5c44a29d9d24f71e791663a3f.wss

 

to the song name that will be post as a var to the script.

and this 3fdc92b5c44a29d9d24f71e791663a3f.wss will turn into Eminem - Mockingbird.mp3 and download.

 

is that possible?

Edited by Mancent
Link to comment
Share on other sites

see this is my uploader script and i want to convert it back to the name of the song.

 

 

$filetempname=$_FILES['Filedata']['tmp_name'];
$ext =".wss";
$filename=md5(md5($filetempname)).$ext;
move_uploaded_file($filetempname,$filepath.$filename); 

 

but then when i download it it I want it to go back to

 

$filename ='3fdc92b5c44a29d9d24f71e791663a3f.wss';

$SongName='Eminem - Mockingbird';

$ext =".mp3";

$filename=$SongName.$ext;

 

and some way to download it. I don't know how to do that.

 

so is there some way to make it do something like this.

 

download as $Temp_FileName(http://wiistream.com/users/100001957015772/sounds/3fdc92b5c44a29d9d24f71e791663as3f.wss);

Convert as Filename http://wiistream.com/users/100001957015772/sounds/Eminem - Mockingbird.mp3

Edited by Mancent
Link to comment
Share on other sites

When a file is being downloaded you basically cannot do much. A file will be downloaded with the same name that it has on the server, which leads to the question - why bother hashing the name of the file?

 

Actually, you can suggest a filename using a header:

 

header('Content-Disposition: attachment; filename="suggestFilename.ext"');

 

I say suggest, because the user can always change it in the "Save As" dialog box.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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