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
Share on other sites

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.