Jump to content

Streaming file problem


LLLLLLL

Recommended Posts

I sell shopping cart software that allows digital downloads of files. It always works, for everyone. Until now.

 

This guy has a 56MB file for customers to download. It fails on his server. But on my server, that same file is downloaded without issue. I think maybe there's some file size limit on his server or something. Any thoughts?

 

This is the code that "downloads" the file to a customer's browser:

 

// Set headers and stream the file to the client browser. the attachment
// filename is only the filename, but readfile must be the full path.
header( "Content-Description: File Transfer" );
header( "Content-Type: application/force-download");
header( "Content-Length: " . filesize( $filename ) );
header( "Content-Disposition: attachment; filename=" . $dp->filename );
readfile( $filename );

Link to comment
https://forums.phpfreaks.com/topic/239907-streaming-file-problem/
Share on other sites

The chat session guy from this webhost is pretty much useless. Someone suggested that I cannot stream files from folders that don't have a URL. That's not right because there are no other sites that require this.

 

Again, is there a possible server setting for something like this?

 

Thanks again....

I have more information about this:

  • Large files can be streamed from public (URL-able) directories
  • Large files cannot be streamed from private directories
  • Other files can be streamed from either/or

 

So is there a combination of settings here?

 

Note that the server is using CGI.

Archived

This topic is now archived and is closed to further replies.

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