Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Files can't be viewed or downloaded on the mobile apps. #79

Open
navjotjsingh opened this issue Jul 6, 2022 · 11 comments
Open

Files can't be viewed or downloaded on the mobile apps. #79

navjotjsingh opened this issue Jul 6, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@navjotjsingh
Copy link

This issue seems to be persistent on both iOS and Android apps. It can even be replicated on the web app when accessed through the phone.

For the iOS app, the bug has already been documented. #73 (comment)

I can confirm that I am getting the same error when I try to view or download the file via the Android app.

Downloading gives me a 0-sized file. While trying to view it, I get the same error as reported in the link above.

Could not obtain content-range header while downloading.

The preview also shows me an empty file when I use the web app on my phone. And it looks like I can't even upload files from my phone.

@navjotjsingh navjotjsingh added the bug Something isn't working label Jul 6, 2022
@BobWs
Copy link

BobWs commented Jul 28, 2022

Still no solution in the latest version!

@jonwsoto
Copy link

you have to use a public facing url that Is setup with reverse proxy for the files url

then you need to add

proxy_cache off;
to your reverse proxy config

@BobWs
Copy link

BobWs commented Jul 28, 2022

you have to use a public facing url that Is setup with reverse proxy for the files url

Sorry to bother you again, but I can't seem to get it to work.

I've added this FILES_SERVER_URL=https://files.mydomain.com to files.env rebuild the container but it still isn't working (for the mobile apps).
If I go to https://files.mydomain.com in a browser I'm getting an error on the page Cannot GET /

I'm not sure how to setup the proxy_cache off; setting with reverse proxy. I'm using Ngnix Proxy Manager (NPM) as my reverse proxy on a Synology Nas.

Could you elaborate a bit more with examples and/or share a config file?

@jonwsoto
Copy link

jonwsoto commented Jul 28, 2022

Are you using bare metal install? I am using a docker for the NPM

I also get the error on the page Cannot GET / which I believe is just a 404 page and is normal.

Disclaimer I am by no means an expert on this but from what I gathered the only way to add header configs in NPM through the admin panel is under the custom locations. Here is a screenshot. The other way is digging into the config files and seemed more complex. I saved this screenshot when I was figuring this out I have no idea the source anymore…. I am not near my comp to screen shot mine so the headers in there are different than what I use anyways.

23F417E4-4608-4685-A232-C8ED77B8B5AF

Here is my block of headers that I have understood are helpful to harden your http requests

add_header Content-Security-Policy upgrade-insecure-requests; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Xss-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header Permissions-Policy "interest-cohort=()" always; add_header Referrer-Policy "no-referrer" always; proxy_cache off;

as you can see the proxy cache one is at the very end.

Here is a site you can go to to test your domains security score

https://securityheaders.com/

If anyone else wants to chime in about the best headers to use to secure your server please do!!

edit
You got me to review headers. Found this article, very interesting and reviews them nicely. I need to review mine lol.

https://www.validbot.com/info/security-headers.php

@BobWs
Copy link

BobWs commented Jul 29, 2022

Are you using bare metal install? I am using a docker for the NPM

Thanks for sharing! I’m also using NPM Docker.
I will look at it and make the necessary changes and see if it works.

@BobWs
Copy link

BobWs commented Jul 29, 2022

Well I've tried but no joy! Still isn't working.

Now I got no error message but a popup that something is downloading but nothing else happens.

IMAGE-1

I think that somewhere something is not set right, but I have no idea what and where to look for it.

Thanks for your help so far.

@jonwsoto
Copy link

Check the developer tool under the app. And see console and under network. Any errors? I noticed larger photos for me took much longer and seemed to hang but did go through. Try a small file?

@BobWs
Copy link

BobWs commented Jul 30, 2022

Okay I give up for now since I can't get it to work!

I can upload and delete files (WiFi ios devices) but I cannot view them.
With mobile data on (4G ios devices), I can't do anything at all, neither upload files nor view them.

I have also tried it with an Android device but it does not work there at all (WIFI and data 4G).

Standardnotes is really a mess for selfhost, there are 5000 containers to install and maintain. They regularly change something in the configuration and you have to find out where it is and how it works. Very frustrating.

I think I will switch to Joplin, where you have one server and one database.

@dotbugfix
Copy link

Changing the EXPOSED_FILES_PORT in the .env file to 80 made it work for me. Presumably the default was 3125 but the nginx-proxy-manager only listens on port 80. Removing :3125 from FILES_SERVER_URL is also necessary, but not enough.

@BobWs
Copy link

BobWs commented Sep 17, 2022

Changing the EXPOSED_FILES_PORT in the .env file to 80 made it work for me. Presumably the default was 3125 but the nginx-proxy-manager only listens on port 80. Removing :3125 from FILES_SERVER_URL is also necessary, but not enough.

Thanks for sharing!
Unfortunately your suggestions didn't work for me. I can't change port 3125 to port 80 because port 80 is already in use. It is default reserved for DSM on my Synology NAS and blocked for other use. So that wouldn't work for me.
Still I can upload and preview the files on my MacOS desktop app but not on any mobile devices.

And also after I updated to the latest version with using the latest:tag my uploaded files aren't saved into the upload folder anymore. I'm convinced that it was before the case when I used the version specific tag.

@drapado
Copy link

drapado commented Oct 6, 2022

Interestingly, if you opt in for the "New mobile experience" in the android app, the file upload works. However, there's a size limit around 1-2 MB

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants