Progressive web app unable to download files - ionic-framework

Good day
I am currently trying to develop a progressive web app for a Moodle site, but I am unable to download files from the Moodle site.
I made use of https://www.pwabuilder.com/ to build the PWA and generate the service workers. I added the service workers to the https Moodle site, as required. The service workers are registered as they should be when using the PWA.
The PWA work perfectly for opening external links soos as URLs (URLs open in the app browser as needed).
I am however unable to download any files such as pdf documents from the moodle site.
I tried to develop an Ionic app with a basic iframe which embeds the Moodle site in order to determine if that would work. I was able to open external links as well, but still unable to open/download documents.
I then embedded the following website http://www.pdfpdf.com/samples/ in an iframe in an Ionic app, which hosts some sample pdf files. I was then able to download the pdf documents as needed.
I them embedded another website from another server that we have, but was also unable to download any documents
When emulating the Ionic app in a browser, I have always been able to download files as needed, as it is just another "browser" accessing the files.
So my guess is that some configuration on the server is blocking the download of files when requested from an app such as a progressive web app?
Any help or pointers would be highly appreciated.

Related

How to save Flutter web file_picker selections to host directory

There are numerous examples online for using file_picker and uploading to Firestore, SQL etc; but it appears there are none for uploading right to the webhost directory where index.html is being served (i.e ./uploads).
As I am using flutter web in a corporate environment my options for spinning up remote storage options are nearly nil. I merely want my flutter web app to allow users to upload to our own environment (I host my web build off Sharepoint and it works perfect).
The solution for posting to web found here (https://stackoverflow.com/a/65759028/82856) is very close to what I need except for the http.MultipartRequest part as I don't have a server API listening for POST requests. What other options do I have for merely writing uploads to a directory like ./upload? Thanks in advance.

Migrate ionic app in a server as a website

I have an ionic app that is connected to the mySQL database from a server and I want to migrate this app to the same server. I want to use this application as a website, which will continue to extract data from the mySQL database. How can I do that?
Thank you.
First I think you should probably split this into two projects:
the Ionic app, which communicates with the server via the API
the server side API (PHP file) with connection to the database
Usually these two would be in separate (Git) repositories.
You can then execute ionic build --prod to build the Ionic app for the web. The deployable files will be in the www directory once the command has finished. You can copy the files in this directory to a webserver like Apache or nginx, or you can easily deploy it to Firebase Hosting for example as well. It's just static files (HTML, CSS, JS, images, etc.).
You can find more information about deploying an Ionic app as a PWA (progressive web app) here. It also shows you how to deploy to Firebase Hosting, which has a free plan to get started with.

I’m using (gulp) HTML,sass,js . How can I upload it to my online seever?

I am using Gulp, and I have build one admin template just for practice purpose. I'm searching on Google and YouTube but I didn’t find any solution.
Am I able to upload this website to my server? If I remove node modules and then upload it to the server, will it work?

How to open page directly in Ionic 4 from url

I have a project in Ionic 4, when I do ionic serve it runs at localhost:8100/
Now when it loads home page, the URL is localhost:8100/home, if I open contact page the URL becomes localhost:8100/contact.
When I try to copy the above URL and hit, then it says -
Sorry, this page doesn't exist. Please check the URL or go back a page.
What do I need to do to get this working?
Based on your comments this is happening because your server does not support fallback. So when you enter a url manually, the server is trying to find that page, but you only have index.html in your app because of Client side routing.
If the app uses the Angular router, you must configure the server to
return the application's host page (index.html) when asked for a file
that it does not have.
The configuration is specific to your server or cloud platform. You can check Angular deployment for more info.
This regularly should not happen and you can't do anything for this. Try to upgrade your ionic to the latest with nodejs since the error my be from currupted project creation. Then after update create a new project and it should go good.

What files to package Atlassian Connect Express Confluence Macro

I am trying to find what files to upload and where for my web confluence plugin. I know the atlassian-connect.json needs to be uploaded to an https:// location. Do I upload that project root direct in the same location as well as all the folders, or can I skip uploading the node_modules folder?
You need to host the whole app on a hosting platform that you choose, and yes that includes the atlassian-connect.json file. Once you upload it and have it running you can install it into your Confluence app using the url to your atlassian-connect.json file.
If you haven't already, you should go through the Getting Started guide on the docs. This will walk you through setting up an app and getting it running locally and installing a running app into Confluence.