Hi,
I am using Simple Oauth2 module for user authentication and setting Bearer token (access_token which received from simple_oauth2 service) in Authorization header for every requests. When I post a file from POSTMAN REST client, I am getting the following error.
[client 127.0.0.1:45600] Uncaught PHP Exception RuntimeException: "SplFileInfo::getSize(): stat failed for /tmp/php3qDWbF" at /path/to/php-file,php
Tried a small file with size just 9.5 KB only, but still I am getting the same error. I also tried the following experiment based on the post found in stackoverflow. But it didn't work for me.
- post_max_size must be larger than upload_max_filesize
- memory_limit should be larger than post_max_size
Any thoughts ?
Thanks,
Comments
Comment #2
anoopmohan commentedComment #3
anoopmohan commentedComment #4
e0ipsoAny suspicion why this is this module's bug?
Comment #5
anoopmohan commentedIt works correctly if we have done cookie based authentication. When we use the bearer token for the same API, it fails.
Comment #6
e0ipsoI'm not able to reproduce this locally. Any other tips that can help someone to fix this issue?
Comment #7
slivorezkaI got the same bug.
e0ipso, to reproduce this locally try it:
And try do a request to this callback method via Postman or any other code.
If I use Bearer token authentication I get this PHP error:
RuntimeException: SplFileInfo::getSize(): stat failed for /tmp/php4dhg5s ...But if I use cookie based authentication all Ok.
Also, for anonymous users all Ok too.
Comment #8
e0ipsoHave you tried https://www.drupal.org/project/jsonapi_file or https://www.drupal.org/project/drupal/issues/1927648?page=1#comment-1246...? Those could contain good tips.
Please post back any findings!
Comment #9
e0ipsoClosing for now. Please reopen if necessary.
Comment #10
e0ipso