Search code examples
javaandroidandroid-studioparse-platformparse-server

Unable to download pdf files bigger than 20mb from parse server


I have uploaded PDF files to the parse server some of them are above 20mb. These files cannot be loaded with Google preview as I try to load them into webView.

The files above 20 mb I open them through intent.

if (isLessThan20) {
                myWebView.getSettings().setAppCacheEnabled(true);
                myWebView.loadUrl(Url);
                //url is the *https://docs.google.com/viewer?url= + pdf link*
            } else {
                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                startActivity(browserIntent);
                //only pdf url
            }

The pdf loads successfuly for fast internet connection but it doesn't load for internet speeds of around 1mbps.

What I think is the parse server timesout before the pdf can be loaded successfully.

Following is the sample link:

http://15.206.28.221/parse/files/8e207ab717fc666494e38973c099fa517fc06b54/1cded668b42d8b779803a34498abca7d_a.pdf

Try loading the pdf and please let me know.


Solution

  • I was able to download the file on my fast internet connection. You are likely correct that something is timing out. We'd need more info to figure out where the timeout is occurring.

    My suggestion is to not use the Mongo Gridstore to store large files. Instead, use either AWS S3 or Google Cloud Storage either of which will solve this problem.

    see: https://github.com/parse-community/parse-server#configuring-file-adapters