M
M
maragon2018-05-12 20:41:57
PHP
maragon, 2018-05-12 20:41:57

How to download photos from classmates php+curl?

The ok.ru API, when calling the users.GetCurrent method, returns the following image url,

https://i.mycdn.me/image?id=867417818889&t=33&plc=API&ts=00000012323000000460&aid=1266517504&tkn=*GZnU3ZiG9vIztk7aHwE7-FYpdwA

How to download a curl photo with a link of this kind?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yan-s, 2018-05-12
@Yan-s

there is no image format in it, you can of course download it by writing the jpg format ($newname = time() . '.jpg'), but what if there will ever be a png?

that is why the format is not defined by reference, anything can be specified as an extension. Determine file type by MIME.
https://ru.stackoverflow.com/questions/825798/%D0%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question