Jump to content


Photo

Net2ftp modifications


  • Please log in to reply
1 reply to this topic

#1 avgenisis

avgenisis

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 30 July 2013 - 05:51 PM

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.o...pic.php?id=3083

Any help on solving this would be much appreciated.

#2 kicken

kicken

    Wiser? Not exactly.

  • Gurus
  • 2,576 posts
  • LocationBonita, FL

Posted 30 July 2013 - 08:29 PM

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, 30 July 2013 - 08:31 PM.

Recycle your old CD's, don't trash them!
Did I help you out?  Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com