Re: Problem with Function.
I added debug messages after each line in the code and it stops it never displays the debug line after the line of code
but only on the third file. It displays the message for the first two. I tried running the code with only 2 files to upload and they upload perfectly so i tried it with 4 files and it fails on the third again!
I'm doing a couple of more tests so i can let you know of any other results i find, but if anyone thinks they know what my problem may be then i'd be really grateful of any input.
Thanks guys :thumb:
Re: Problem with Function.
Try wrapping it around an If block and check to see if there is a response first....
VB Code:
If req.HaveResponse() Then
req.GetResponse()
End If
Re: Problem with Function.
Could you explain to me why i would need to do this as it may help me understand the process of uploading using http even more. I'll try it out and let you know what i get.
Thanks for your help.
:thumb:
Re: Problem with Function.
Stanav,
I tried what you suggested and it didn't upload anything at all that time!
Re: Problem with Function.
Re: Problem with Function.
I have added a few more message boxes to try and find out whats happening and when i add a message after the line
VB Code:
Dim bytesRead As Integer = rdr.Read(inData, 0, inData.Length)
to display what bytesRead is initialised to it returns the size of the xml file it is trying to upload and then i added a debug message inside the while loop and only one message displays and this shows bytesRead = 0.
Don't know whether this will help at all but i really need this problem sorted asap so i thought i's supply all the information i know!
It turns out the web request isn't even hitting the server!
Please can anyone help?
:thumb:
Re: Problem with Function.
Re: Problem with Function.
I am trying to work around my problem by only uploading a certain amount at a time, but if someone could possibly tell me why it always fails on the third upload i would really appreciate it, because i can't think of any reason why it would be failing when it has uploaded 2 files successfully directly before trying the third one???
Can anyone please help
Thanks :thumb: