Closed sdussaut closed 2 months ago
@sdussaut Can you share the request with me? Reading through the code, I can see that there's some potential issues around filenames.
Thanks! It works with the new release.
One thing to note though: I was having an error at first with this line specifically file_put_contents(storage_path('tmp/'.$tmpPath), $contents);
in /src/Http/Controllers/AssetController.php
.
It was because the tmp
directory in storage
did not exists. I check on another Statamic installation I have and it does not exist there either. I am wondering whether a check regarding the existence of this directory should be added too as a safeguard.
Once I created it, it worked fine though.
Thanks again for the quick fix!
Thanks! It works with the new release.
One thing to note though: I was having an error at first with this line specifically
file_put_contents(storage_path('tmp/'.$tmpPath), $contents);
in/src/Http/Controllers/AssetController.php
. It was because thetmp
directory instorage
did not exists. I check on another Statamic installation I have and it does not exist there either. I am wondering whether a check regarding the existence of this directory should be added too as a safeguard. Once I created it, it worked fine though.Thanks again for the quick fix!
Thank you for the feedback @sdussaut The tmp path is opiniated and shouldn't be.
I have created a PR which will solve this requirement and just use the build in temp dir in PHP. https://github.com/tv2regionerne/statamic-private-api/pull/24
Hi!
I am trying to upload an asset through the private API and I get a weird error with no details whatsoever to understand where it is failing.
I send this request:
/api/private/asset-containers/assets/assets
with afolder
field set to/
and afile_url
set. The request fails and sends a422 Unprocessable Content
code with the following message:What I can see is that the image is successfully created into the
tmp
folder instorage
but then fails at uploading it. There is no trace into the laravel logs either.Any idea on what could be happening?
Thanks!