Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-05-2005, 10:26 PM open save dialog box
starsunited's Avatar
Extreme Talker

Posts: 211
Location: Singapore
Trades: 0
i have a question. my function works in a way that once user clicks the link, the open save dialog box will pop out then the user have a option to choose whether to open or save the mp3 file.

The problem is the save function can wrk meaning if user save the mp3 file and listen, everything is ok. But when the user try to open the file straight away, the mp3 file cannot be open. There will be an error msg. I do not knoe how to go abt to solve this error.

is there a way to enable the user to open the file straight away once the link is clicked? i have try to put a link to the mp3 file but that would result in the user from seeing the location of the mp3 file. I have try to mask the url but then if the user clicks view source, the user would be able to see the location of mp3 file.

Below is the codes that cause the open save dialog box to pop out

Quote:

$currentdir = '../mp3;

$filename = "$trackname.mp3";
$pathname = "$currentdir/$filename";

$fr = fopen($pathname, 'r');
$filedata = fread($fr, filesize($pathname));
fclose($fr);

header ( 'Content-Length: ' . filesize ( $pathname ) );
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=$filename");
readfile($pathname);
__________________

Please login or register to view this content. Registration is FREE
starsunited is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-06-2005, 03:06 AM
starsunited's Avatar
Extreme Talker

Posts: 211
Location: Singapore
Trades: 0
just found out that this error only occurs in IE. i try it out in firefox can
__________________

Please login or register to view this content. Registration is FREE
starsunited is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to open save dialog box
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.86709 seconds with 12 queries