Jump to content

"Secret" download URLs


ecopetition

Recommended Posts

Hi,

 

I'm looking to make a file have a secret URL with PHP. I want it so that the URL www.x.com/files/file.zip is shown as www.x.com/download.php?file_id=1 (or otherwise). The filename is stored in a database, is assigned a unique ID, and the actual file is stored in a folder under and encrypted name (random MD5 hash).

 

I tried searching this but only came up with one script which wasn't suitable.

 

Any ideas?

 

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/117729-secret-download-urls/
Share on other sites

That usually means you are calling it wrong. You need to call it like: http://yoursitename.com/directory/phpfile.php?file=<id>

 

Undefined index usually means the variable you are tying to call does not exist. And remember that PHP is case sensitive, so ?File= and ?file= are not the same thing.

 

See if that clears it up.

Link to comment
https://forums.phpfreaks.com/topic/117729-secret-download-urls/#findComment-605647
Share on other sites

Notice:Undefined Index ........

 

PHP Error reporting is set to E_ALL or E_NOTICE.

 

 

ini_set('error_reporting', E_ERROR);

 

Drop that in your page(s) and it will take error_reporting to a less strict level. Or on the other hand, you can fix the errors by initiating the variables first.

 

Nate

Link to comment
https://forums.phpfreaks.com/topic/117729-secret-download-urls/#findComment-605806
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.