Downloading a file with a different name to the stored name

Sure, use a Content-disposition header

header('Content-Disposition: attachment; filename="filetodownload.jpg"');

if you wish to provide a default filename, but not automatic download, this seems to work.

header('Content-Disposition: filename="filetodownload.jpg"');

Leave a Comment