cURL requesting URL with whitespaces in URL.. What to do

回眸只為那壹抹淺笑 提交于 2019-12-04 22:22:41

Just use str_replace.

echo str_replace ( ' ', '%20', 'http://images.fastcompany.com/upload/Screen shot 2011-04-28 at 8.13.21 PM.png' );

Perhaps try replacing spaces with %20?

I use:

$link = trim($link);
$link = str_replace ( ' ', '%20', $link);
Mitchell M

Use the str_replace(); function. Replace your " " with "%20"

For me just to put the name with spaces between "" worked.

Example

curl --upload-file "001- name - lastName.pdf" https://transfer.sh/ernesto

Notice the use of "" in "001- name - lastName.pdf"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!