Response is always downloaded as file






















This post may contain affiliate links which generate earnings for Techcoil when you make a purchase after clicking on them. Such earnings keep Techcoil running at no added cost to your purchases. Please read my disclosure for more info.

Previously, I had written two posts on how to upload files to a web server, one for the case when the size of the HTTP request is small, and the other for the case when the size of the HTTP request is large. The first directive is always form-data , and the header must also include a name parameter to identify the relevant field. Multiple parameters are separated by a semi-colon ';'. Is followed by a string containing the name of the HTML field in the form that the content of this subpart refers to.

Is followed by a string containing the original name of the file transmitted. The filename is always optional and must not be used blindly by the application: path information should be stripped, and conversion to the server file system rules should be done. Gagan Gagan 4, 6 6 gold badges 43 43 silver badges 70 70 bronze badges. Use Fiddler fiddler2. Oh, if that's going to an in-development website on localhost - you might have to change to using your machine name or ipv4.

This isn't specific to jQuery; hence it's a duplicate of this question. Add a comment. Active Oldest Votes. Improve this answer. Andreas Andreas 9 9 silver badges 19 19 bronze badges.

Looks like it's the same for IE8 and 9. Harry Forbess Harry Forbess 2, 3 3 gold badges 16 16 silver badges 15 15 bronze badges. Community Bot 1 1 1 silver badge. Nicholas Murray Nicholas Murray Thanks for your answer, but this is not solving my problem.

My problem is, why IE8 downloaded the json response as a file. The get method requires one argument: a web URL, e. The URL's scheme — i. But it turns out there's a lot more to getting a webpage than just getting what you see rendered in your browser. What each of those various attributes mean isn't important to figure out now, it's just enough to know that they exist as part of every request for a web resource, whether it's a webpage, image file, data file, etc.

Returning to our previous code snippet, let's assign the result of the requests.



0コメント

  • 1000 / 1000