SimpleBrowserDotNet/SimpleBrowser

Getting Error on Image Upload

Closed this issue · 11 comments

I tried to upload Image through this https://goo.gl/fwYvLz .

Page Source https://jsfiddle.net/rob488gt/

It works but after completing upload I use to get

An exception was thrown while trying to load the page: The remote server returned an error: (404) Not Found.

You can check the Log here https://jsfiddle.net/ueheeq8k/

I don't have a Facebook account. I don't know how to help you.

Can you check the source link that I provided? please

I see it. I've uploaded a photo to it. I suspect that there is JavaScript involved that may be causing issues. The JavaScript runs in browser-hosted JSFiddle, but not in SimpleBrowser. Based on experience with other similar sites, the JavaScript will set the token values in the form. Without JavaScript, the token values may not be set, that may cause the 404.

That is all conjecture, of course.

Can you share your C#? That may help in debugging the issue.

Thanks for your response. Excuse Me, I'm a VB guy and This is it https://pastebin.com/WdVs7Ad0 And this https://pastebin.com/Rm0RJaxy is C# from http://converter.telerik.com

Your code looks like it should work, based on the HTML in the JSFiddle. I don't see anything in the HTML that is suspect. Where did you get the HTML? Was this HTML copied from SimpleBrowser or a browser that has JavaScript capability? If it's not from SimpleBrowser, can you paste the HTML from SimpleBrowser?

This is the jsFiddle http://jsfiddle.net/n6kz4Lto/ Please check.

I have just taken it from SimpleBrowser.

Both HTML sources are close enough to being the same (which is good). I noticed there is JavaScript in the page that deals with the form post and the image upload. Since the JavaScript is not being executed in SimpleBrowser, that may be what is causing this problem. This is what I would do next:

  1. Open Fiddler (If you don't have Fiddler, it can be downloaded from https://www.telerik.com/fiddler)
  2. Submit the form (upload the image) using Chrome
  3. Submit the form (upload the image) using SimpleBrowser
  4. Compare the two submissions in Fiddler

This technique might reveal what the JavaScript is doing. If so, you may be able to replicate that in your VB code. For example, it looks like the JavaScript is adding HTTP headers to the form post. If that is true, you will need to add those manually.

@takielias Did that work for you? Has this issue been resolved?

Yes, It's resolved.