I'm programatically uploading pdf files and want to set the filename. When I upload a file via POST, the filename property is set automatically. However when using the method below, it renames it something like "s9QmBqJPuiVzWbySYvHVRg==" and there is no filename.
$gs_file='gs://<bucket-name>/proposal.pdf';
$options = ['gs' => ['Content-Type' => 'application/pdf']];
$ctx = stream_context_create($options);
file_put_contents($gs_file,$content,0,$ctx);
If I download then add .pdf as extension, it opens as the original pdf fine, so the actual file itself has uploaded ok, but its just the filename and .pdf extension. Is there a way to have the file retain its original filename when uploaded?
I have seen a solution to this, but its in python.
Note: I am testing this out on my local environment before deploying. Is the handling of filenames different when testing it locally vs live on Google App Engine?