Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save Post File issue
#4
(03-16-2022, 07:58 AM)Blanca80 Wrote:
(03-16-2022, 12:55 AM)Alexandre Machado Wrote: This doesn't look right to me. I believe you are not sending the data (the file) with proper content-type header field. It needs to be "multipart/form-data" so IW will parse the content out of that stream for you, automatically, set the file name accordingly, etc.

Hello, 

The program who sends the request is an old one done in C#

the code in C# is: 

WebClient wc = new WebClient();             

byte[] responseArray = wc.UploadFile(url, "POST", fileName);                

Log.Text = Log.Text + "\nSubirFichero.responseArray: " + System.Text.Encoding.ASCII.GetString(responseArray);
sw.WriteLine(Log.Text);

wc.Dispose();


where filename is a file from client pc who sends the request to the server (url) that is a content handler in IW. 
I don't add any header to it. I think visual studio do that within uploadfile function.
Maybe there is any incompatibility between visual studio and intraweb? 

Thank you 

Blanca

Hello Alexandre, 

Finally i've solved the problem changing the request in c# and adding the headers. Thank you very much for your orientation, that helped me to find the solution. 

kind regards!

B
Reply


Messages In This Thread
Save Post File issue - by Blanca80 - 03-14-2022, 04:14 PM
RE: Save Post File issue - by Alexandre Machado - 03-16-2022, 12:55 AM
RE: Save Post File issue - by Blanca80 - 03-16-2022, 07:58 AM
RE: Save Post File issue - by Blanca80 - 03-16-2022, 04:19 PM
RE: Save Post File issue - by Alexandre Machado - 03-17-2022, 03:43 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)