In a support thread titled ‘Image upload with synchronous true for new users,’ Kenneth85 reports that when uploading images via the API with synchronous=true, non-staff users receive only {"success":"OK"} instead of the expected image URL — a response that works correctly for admins and moderators. techAPJ initially confirms image uploads work for all users, but RGJ identifies a code-level restriction limiting synchronous uploads to staff and API users. sam and zogstrip explain this is a security measure: allowing non-staff users synchronous uploads could overwhelm server resources by triggering CPU-intensive image processing, risking denial-of-service. The restriction was originally API-only, later extended to staff by @eviltrout for the wizard feature. Kenneth85 thanks the team for clarifying the limitation.
When i try to uploade a image with a user that is not a admin or moderator i get the success : “OK” insted of the image url. Hobe some one can help with a answer.
Hi
I am using the api with the synchronous true parameter to get the image url back with the responce. But this only works with admin and moderators and i cant find out why.
Im creating a new editor for the company pleasecreate and are using the file upload api with the synchronous true parameter. When the image is uploaded i use the url from the response data in the post. The problem is that when a user that is not admin or moderator upload a image the response data only contains {“success”:“OK”}. and not the url. The code working for admin and moderators is shown below.
There is an explicit check in the code for staff users with regard to synchronous uploads. I don’t know why this is done but this is clearly the cause.
Why is the synchronous upload limited to staff users or API usage?
Since we might do a CPU-intensive process when images are uploaded, we have to ensure users don’t DDoS the instance by uploading lots of very large images.
Initially, synchronous mode was only available via the API. @eviltrout recently allowed staff members too when he added the wizard.