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.

Coding Forum


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



Reply
Downloading Images/Movies
Old 11-27-2003, 07:13 PM Downloading Images/Movies
Junior Talker

Posts: 3
Trades: 0
When you click a link to an image or movie or certain other formats the file opens with a designated program.

I was wondering if using a any scripting language at all (server or client side) that I could use to get the file to open in a download box?

Thanks in advance...

~Sk8rRIMuk
__________________
If logic is of no use with out knowledge, what use am I? ~ Sk8rRIMuk

Last edited by Sk8rRIMuk; 11-28-2003 at 07:20 AM..
Sk8rRIMuk is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-28-2003, 05:35 AM
praveen's Avatar
Life is a Dream

Posts: 3,591
Name: Praveen
Location: Chennai, India
Trades: 0
most of the server side scripts has a feature like this.. could not get one in mind now..

but hop on to hotscripts.com and try with php.. best bet is that one..
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
praveen is offline
Reply With Quote
View Public Profile
 
Old 11-28-2003, 05:49 AM
Junior Talker

Posts: 3
Trades: 0
I managed to find this script:

PHP Code:
if(isset($_GET['file']) && file_exists($_GET['file']))
{
  
header("Content-Type: application/octet-stream");
  if (
strstr($_SERVER['HTTP_USER_AGENT'], "MSIE 5.5"))
  {
    
$attachment "";
  }
  else
  {
    
$attachment "attachment;";
  }
  
header("Content-Disposition: $attachment filename=\"$file\"");
  
header("Content-transfer-encoding: binary\n");
  
header("Content-length: " filesize($_GET['file']) . "\n");
  
$fp fopen($_GET['file'], "rb");
  
fpassthru($fp);
}
else
{
  print(
'<span class="errors">Error: </span>');
  print(
'You did not request a file, please make sure you followed a correct link.');

When you have already downlaoded the file and it's in your cache... it will just open in the window as an image

However if I run a pop-up, get the user to click the downlaod link from there the file opens in a prompt always.

It may in the end go through two files rather than one but that is fine

Thanks for the help.
__________________
If logic is of no use with out knowledge, what use am I? ~ Sk8rRIMuk

Last edited by Sk8rRIMuk; 11-28-2003 at 07:23 AM..
Sk8rRIMuk is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Downloading Images/Movies
 

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.28762 seconds with 12 queries