Having trouble figuring out what is need to successfully upload a file that contains spaces in the filename and also a directory that contains spaces. I’ve tried replaces the spaces with %20 but still am getting a 400 bad request response. What is the correct cURL syntax for this?
curl -H application-id:A7B…00 -H secret-key:655…00 -H Content-Type:“multipart/form-data” -H application-type:REST --form upload=@“my file is this.txt” -X POST -v “https://api.backendless.com/v1/files/Testfiles/myfile is this.txt”
curl -H application-id:A7B…00 -H secret-key:655…00 -H Content-Type:“multipart/form-data” -H application-type:REST --form upload=@“my file is this.txt” -X POST -v “https://api.backendless.com/v1/files/Test files/myfile is this.txt”
The documented you pointed to help with spaces in the input filename but what I don’t know is how to format the URL that contains spaces in either the directory name or the file that will be created as a result of the REST API call.
I tried your exact curl command and I didn’t get the same results. Below is the request and response. I would like to be able to support REST API calls to upload a file with a filename and/or with spaces.
Sorry, I posted the snapshot of a request with the file already uploaded. Here is the clean request response. I tried the URL enclosed with quotes like you had and also got the same response.
Trying to figure out the necessary encoding in order to upload a file to a directory that contains spaces in its name.
The following curl command doesn’t work for me. The response contains the directory name - …/txtfiles/dir0with0spaces/test.txt. NOTE: The directory in Backendless didn’t exist prior to the curl call.
I can use the %20 and + but the response should contain the spaces also. In addition, the directory that is actually created by the request should reflect the spaces in the directory name.