I develop a plugin for wordpress which download image from URL for create a post(article).
For the most part, the image is download and article posted but sometime, for curious reason, the image is not download.
Specifically, a file corrupted is download without declared errors. (like download is cutted pending process)
Look this link. You can see this image with your browser without problem.
But my plugin cannt download this file. You can test that with this site :
img uploader
Try to upload this image with this site and you will have a error. But why ?!? The image can be open in browser! I become crazy, do you have idea please ? I don’t know what can i search on web for find a solution..
Thanks you
Using curl I didn’t have any issue to download this image:
I guess you were using
file_get_contents
instead. Downloading the picture binary through curl seems to bypass the limitations.Thanks you so much Vard, it’s working perfeclty!
But i give informations for other peoples : Some server don’t active CURL, so you must check it before use this hack.
Code for check that :
Grand Merci Vard (sorry i don’t have enought point for a positive vote about your response but you are so kind)