Jump to content

HTTP downloads using FTP functions


calkette1

Recommended Posts

This seems like it would be easy, but I can't quite figure out the best way to do it.

 

I have a download repository of files named w/ index values stored in a MySQL table.  These files reside on a separate logical FTP server (actually one and the same, but hackers need not know where these files are stored).  I want to be able to FTP get a file, rename it to its true filename (also stored in the db), then pass it through as a HTTP download.

 

I'm not sure quite how to do this efficiently.  I'm sure this will involve a temp file, but that sounds kinda silly if I can just work with a buffered memory stream.  Can't create a pointer on a memory location... or can you?

 

Assuming $download_id is the index value/FTP file name, and $download_name is the true filename as retrieved from the db, how would I best go about this?

Link to comment
https://forums.phpfreaks.com/topic/108540-http-downloads-using-ftp-functions/
Share on other sites

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.