Jump to content

Recommended Posts

Hi,

 

I'm a total noob at this, I have done some other programming, but never php, anyway, I need a web portal for an FTP site I run, all works well but, when I download files the script caches the file on the same server before download, the files I am shifting are aprox 500mb, so this doesn't work well as you can imagine, it usually crashes the portal....

 

There was a modified script that did away with the caching, and I have updated the code, all seems to work, it des a direct push to the browser, but always saves a zero byte file.

 

The update script is described here

 

http://web.archive.org/web/20110922224413/http://www.net2ftp.org/forums/viewtopic.php?id=3083

 

Any help on solving this would be much appreciated.

Link to comment
https://forums.phpfreaks.com/topic/280655-net2ftp-modifications/
Share on other sites

Using ftp_fget to output the file directly may work. Something like:

header('Content-type: text/plain'); //Whatever headers you need to send

$outfile = fopen('php://output', 'w');
ftp_fget($ftp, $outfile, 'the_file.txt', FTP_BINARY);
Edited by kicken
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.