Monday, November 10, 2008

Uploading a File with IronPython

An example of uploading a file to a website from IronPython:
This is an example of a class in IronPython that can upload a file to a web site. This is a port from a codeplex example (except without cookies...but the addition should be trivial). It uses the WebRequest class.

Points to note are: 1) the parameter query_string is of type NameValueCollection, 2) the parameter url must be a valid URI (e.g. www.somewebsite.com/somepage), 3) the parameter content_type can be 'multipart/form-data'.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.