简体   繁体   中英

My uploaded files are stored on the server without format How to add a format to a file and submit that file to a web service in php?

I need to use the file this way :

        'file'=> new CURLFILE("1.jpg"));

My files are saved here like this: 没有扩展名的文件

The format of these files is JPG

What should I write instead of 1.Jepg?

'file'=> new CURLFile('e9c55359-96ae-3b42-2605-6288ae4f4342', 'image/jpeg', '1.jpg'

What is CURLFILE ? Is it a typo of CURLFile or is it a custom made class ?

You may try something like this: 'image' => new CURLFile('Your_File', 'image/jpeg', 'image') .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM