Message Boards Message Boards

0
|
4663 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

URLExecute for Windows (password issue)

Posted 10 years ago

Hello,

I am working on Linux (Ubuntu) and I have written the following function in order to upload a JSON file (server with 'url' adress):

URLExecute[url, "BodyData" ->"{"a"->"b"}","Method" -> "PUT"]

It works fine for Linux. But it should also work on a Windows Server...

1) Is the "Method"->"PUT" based on cURL?
2) Is there another function or a workaround for Windows?

Thanks! Gordon

POSTED BY: gordon fischer
2 Replies
Posted 10 years ago

Hi again,

how can I manage to upload images (e.g. JPG or PNG) to a server?

f=Import["image.jpg","JPEG"]    
URLExecute["url", 
     "Method" -> "PUT", "BodyData" -> f, Username->"...", Password->"..."]

does not work:

General::erropts: The value XXX specified for the option BodyData is invalid.

The uplaod with cURL is possible (webdav is installed)

Thanks! Gordon

POSTED BY: gordon-fischer
Posted 10 years ago

Hello,

I think the key is the username/password restriction (maybe Windows is more conservative...

URLFetch[url, "BodyData" ->"{"a"->"b"}","Method" -> "PUT", "Username"->"...", "Password"->"..."] 

works fine. I switched to URLFetch due to MM9

Cheers! Gordon

POSTED BY: gordon fischer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract