Once again, I ran into the problem of restrictions of virtual hosting on the size of the download file. Often, the problem manifests itself when users cannot upload a photo taken directly from the camera. And if by a miracle we managed to load it, then PHP does not have enough memory to process it (decrease).
I can offer a large-scale solution to the problem.
It creates a single service that works transparently for the user. My idea is based on using the resources of a single service for processing large images. Let's say we have a website where you need to bypass the hosting restriction:
- In the form of sending a picture, the link to the handler on the service side is written in the action attribute.
- In the same form, several hidden fields are created that describe the image processing parameters (dimensions, quality, etc.). A separate field is created to tell the service where to post the processed image.
- The service receives a request, processes the image, taking into account the specified parameters and posts the processed image to the source site.
Sample form:
The idea can be modified. At a minimum, add support for sessions, but the essence, I hope, is understandable.
')
How do you like the idea? If you know similar implementations, write down in comments.