How to download excel file that is downloadable from server in react - reactjs

I am facing an issue that the file when you hit the URL in browser it auto download but in postman return characters
response from postman
how is it possible to make it downloadable from react? when hit the URL it just return the weird characters response.
I want when click a button just to look like this

Related

Chrome debugger doesn't show Fetch requests in Networks

I have a Fetch API in my ReactJS Application in Dashboard.jsx component. I am successfully getting the data using fetch api but the request to URL fetch("http://127.0.0.1:8001/api/test") not showing in google chrome debugger.
Its not in All tab
Its also not in 'Fetch/XHR'
You seem to have entered "r" into the filter text field, so you only see requests that matches the filter.

angular.js library "angular-img-http-src" with Edge browser

I'm using angular.js library "angular-img-http-src" and my current browser is Edge.
I ran into an issue with uploading images.
In the Chrome browser, there is no problem, the image uploads through an internal file server so the URL points to the file's path and the user token is added to the request header.
In Edge browser, the URL converts to an unrecognized path.
Anyone experienced something similar and can advise a solution?

Error "The connection to the server was reset while the page was loading", While uploading .docx file

I am getting "The connection to the server was reset while the page was loading" error, while uploading a .docx format file. This is happening in all the browsers.
Uploading pdf, zip file formats are working perfectly.
Does anyone know why this is happening, and how it can be resolved ?
Try making a simple html upload page and see if it is possible to upload a .docx file. If it works, then your application code needs further troubleshooting and if by making a simple html upload page the error still persists; then your application code needs no changing, please do contact Godaddy hosting support for server support with this problem.
I am still having this issue with GoDaddy hosting which no longer allows uploads of some docx files. For now, a workaround is just to "Save as..." an older word .doc format which for me seems to work.

File download test in Symfony

I need to test if file will start download when user click on button.
Right now I'm clicking on download button "a.btn-info" via client and it just print text from file into PHPUnit console
$client->request('GET', $crawler->filter('a.btn-info')->attr('href'));
Thank you :)
You can simply perform request with HEAD method like
$client->request('HEAD', $crawler->filter('a.btn-info')->attr('href'));
and check if response code is 200 and there is a "Content-Disposition: attachment" header.
It will mean that file exists and will be downloaded and not opened in browser.

Problems uploading blobs onto App Engine

Hi i'm trying to upload some mp3s as blobs using the Complete Sample App code provided in the App Engine tutorial here and i'm getting the following error `HTTP ERROR 404
Problem accessing /_ah/upload/ag5jb2xsZWN0aXZlZ3dhcHIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGHQM. Reason:
No upload session: ag5jb2xsZWN0aXZlZ3dhcHIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGHQM`
Anyone have any ideas why i'm getting this? Tried running locally and even tried deploying the App and still having issues!
Do not press the back botton and try to upload file.Use to hit the url in browser every time.
For each upload of file to the blob, the blob url is unique. For the first time, when you upload a file, you might be creating one blob url, using
blobstoreService.createUploadUrl("/yourServerURL");
Now, when you try to upload next file, you are clicking back button and you are trying to use the same blob session which you have created for the first file. That is the reason, you are facing the "No upload Session" error.
The solution could be, you can create a new blob url when you click the back button. Do some work around to create a new blob url upon clicking the back button.
Hope this helps.
Thanks.
Seems to be a bug with SDK 1.4.3
This seems to work just fine with SDK 1.4.2
Does this resolve your problem?

Resources