I am using springboot, while downloading pdf file by ajax call in UC mobile browser it is gives protocol not supported Error. Can you guys let me known what is cause?
@PeterPan_321Jun 06.2019 — #I don't use AJAX nor Springboot, ( straight javascript and PHP for me). But I can tell you my usual PHP code for downloading a file looks like this... ``<i> </i>function downloadFile($path) { $path_parts = pathinfo($path); $ext = strtolower($path_parts["extension"]); // don't need this. $fsize =fileExists($path); if ($fsize == 0) return 0;
Now if change the content type to application/octet-stream, (which looks similar to your call), even on a desktop its unpredictable. If its an MP3 or a PDF for example, firefox will try to render or play it, where Chrome will usually just download it. The 'x-file-to-save' instead will either cause download, or an alert box asking whether the user wants to "play/view" the file or save it.
But, I'll also say that I generally block calls to download a file on mobile devices, because the result is hard to control and is often useless. Remember that most (or at least ale ones I know) phone browsers don't have any "file system" to download to. So unless its a file type the browser can directly deal with (many can display PDFs), the end result becomes difficult to predict.
On the client side web page, I'll usually call a PHP file containing my script with an XMLHttprequest, formating the script string with all the parameters I need to pass (in this case a file). Don't know if any of this helps, as I'm not using your platforms
@keithlarsonNov 24.2019 — #I've has a similar issue and I downloaded the older version of UC browser from https://freewindows10.download/soft/uc-browser and I do not update it. It helped me. Maybe try to reinstall the software. Or you can change to another browser but I do not know which one is compatible with springboot.
} els [url=http://http://www.ork.tn/]chercheremploientunisie[/url]
> return ResponseEntity.status(404).build();
> } catch (Exception e) {
> LOG.error("downloadPDF", e);
> }
> return ResponseEntity.status(404).build();
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.
reply?
×
Success!
Help @sushil123 spread the word by sharing this article on Twitter...