I have following form to automate in vb.net:
After I submit the form, I should recieve an XML string similar to this:
The following code doesn't give an error, but I still have no way of knowing if the file I'm trying to upload has made it or not. Is there a way to view the returned xml? The value of the string variable "response" is only "60" I'm not sure what that means. Am I even doing this whole thing right?:
Thanks for any Help!!!
VB.NET:
<html>
<body>
<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data"
action="http://www.nikonet.com/api/customerid.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="5000000" />
<input type=”hidden” name=”AUTH_NAME” value=”john” />
<input type=”hidden” name=”AUTH_PW” value=”mypass” />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
</body>
</html>
VB.NET:
<?xml version="1.0" ?>
<dmsXML version="1.0">
<jobid value="0" />
<rescode value="FAIL" />
<rescode_description value="Submitted Job File Corrupt/Incomplete." />
</dmsXML>
The following code doesn't give an error, but I still have no way of knowing if the file I'm trying to upload has made it or not. Is there a way to view the returned xml? The value of the string variable "response" is only "60" I'm not sure what that means. Am I even doing this whole thing right?:
VB.NET:
Dim RemotePath As String = "http://www.doamin.com/api/rigd_ims.php"
Dim InsertClient As New WebClient()
InsertClient.QueryString.Add("AUTH_NAME", "username")
InsertClient.QueryString.Add("AUTH_PW", "password")
Dim Response As Byte() = InsertClient.UploadFile (RemotePath, "POST", "L:\degg.zip")
MsgBox(Response(0).ToString)
Thanks for any Help!!!