Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force a download ??

Status
Not open for further replies.

jez

Programmer
Joined
Apr 24, 2001
Messages
370
Location
VN
Hi there,
I am trying to build a (server based) download manager, that forces a download of a file.

When i say forces a download, currently if the file is .doc, .PDF, or .xls (typical office type documents) they are opened in a new browser window (not downloaded directly as though "right-click + Save target as.." has happened.
This is ok unless the document is 1 mb upwards in which case the new browser window opens, but is blank for as long as it takes to download the document .
This also causes software to hang and even crash on the client side if they try and do anything significant while waiting.

I have seen and am trying to build a perl script that manages the download..and no problem there, except I can't find a way to Force this download...is there anything in CGI.pm ?? or other module....I haven't found anything yet.


Many thanks


Jez
 
The only way I know for sure to force a download is to zip the files. zip files always force a download. I know that's probably not what you're looking for, but it's one solution. If you find a better one I'd be glad to know too.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Yeah, thanks...although zip files aren't what I need here..they download fine (as you know).
When I do find out though I'll let you know!!
(I think I'll try and do something with this under the GNU and make such a thing available to everyone!!).


Jez
 
I am still looking for something to do this, but i think that it is tied up with file associations on the client machine.
So based on that (whether there is an associated app or not), the browser decides to open or download a file / document.

To get around this the only thing i can think of is to set up an FTP server and have downloads through the browser.
 
Look to see how download.com or Tucows.com does it now. I don't know if that helps at all.
Mike Wills
RPG Programmer

"I am bad at math because God forgot to include math.h into my programming!"

Please let us (Tek-Tips members) know if the solutions I provide are helpful to you. Not only do my posts help you but they may help others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top