AngularJS - Display files from FTP server and download link - javascript

Have an FTP server set up with a number of files. Would like to create an AngularJS page (hosted on a different server) that allows user to click on a link on the angular page and download file(s) directly to the users local machine.
Thanks

Related

How to download pdf file using vuejs and bootstrap-vue

I'm trying to upload a pdf file to my browser, but I want to be able to download this file afterwards. I am having problems on the second task - downloading it.
I'm uploading as follow:
<b-form-file v-model="form.file" :state="Boolean(form.file)" placeholder="Choose a file..."></b-form-file>
How can I download form.file content after upload is done?
Edit:
I found this API, which handles file downloads nicely.
You need to save the file somewhere on your server or on a storage service (ie Amazon S3) and then redirect the user to a link where the file itself is served.
The specific implementation is based on your backend implementation and your architectural choices.

Publish Static Website Using Azure

I have a single html file (index.html) and an image that I tried to host on Azure.
I put them in a dropbox folder and synced, the website got published and Azure status shows running.
I go the webpage and it shows:
You do not have permission to view this directory or page.
Do I need to add anything to make the site work?
You do not have permission to view this directory or page.
In general, when you access your web app : https://{webapp-name}.azurewebsites.net directly, you'd better make sure that the default documents you defined of your web app could be found within your web app. You could leverage KUDU or Azure App Service Editor to check whether your files exist.
#Dai No in Kudu I don't see the files...no index.html and my image file is there.
As I known, Azure would sync the changes (e.g add/remove file(s) in your DropBox deployment repository) and deploy the changes to your web app.
Note: When you delete file(s) synced from DropBox under your website folder(e.g D:\home\site\wwwroot\), the deleted file(s) couldn't be synced from DropBox in subsequent deployments. You could log into Azure Portal, choose your web app, select "APP DEVELOPMENT > Deployment options", check your deployment logs as follows to see the synchronization log.
According to your description, I assumed that you could log into Azure Portal, disconnect your deployment options and setup your DropBox deployment again. Also, you need to check the synchronization log mentioned above and check your files in your website folder via KUDU or Azure App Service Editor.

Can I open / stream a remote file (PDF) in JavaScript and push it to another server?

I'm building out some internal tools for my staff to streamline processes. One particular task that gets tedious is needing to download a PDF file from one website, and then upload that same file to another website we use to send faxes (Hellofax). Hellofax support email -> fax, so I'd like to build a bookmarklet / browser extension to grab the PDF file instead of forcing the browser to download it, and then send it over to a basic web service that could email the file as an attachment. Is this possible?

How to view local files in web browser by displaying and creating a link to local files stored in your computer in your webApp?

I have created a webapp using JSP,Html and Javascript which currently runs on my localhost using apache webserver. I want to display the files and folders and of a directory in local computer. I also want to create a download link or view link of those so that when anyone click on it it will be viewed in new tab or become downloadable as it happens in any ftp server. I know similar type of question has
been asked but none of them worked for me.
To create the download link I used
Download
this does not work as it is not in my webapp path and download attribute also does not work in internet explorer.
I'm not sure why you are exposing your local drive contents on the web but here's an option:
On the page that should display the files, in java code, list all
folders and files then for each file/folder show a link to some page
(for example "navigateLocalDrive" that sends the path of the clicked
file/folder like this:
Download
Now in that jsp, check if the GET variable is a path for a file or a directory,
if its a file, just send it back in the response, if its a
directory, list all files/folders and do the same as in step 1
Please note:
How I encoded the file path in the href in order to work properly.
The Access permissions for the webserver should allow write/read to that path (I'm already doing it on my Tomcat server on local host with the default setup no change needed)
For your reference, here are some helpers for this task:
How to list contents of a server directory using JSP?
Downloading file from JSP/Java
I am not sure if this is possible. In general the access rights are limited to the src and webContent Folder (for your html coding mentioned above for sure) . This is also reasonable, because you do not want to access or change data on your Computer in general, because after local development you want to deploy your web application to a server.
To make a test copy some file to the webContent and you will be able to download it. Within your Java coding you can use some IO package like java.io.File to navigate over folders and files. However keep in mind, that you will get some exceptions like
java.io.FileNotFoundException: C:\WeatherExports\export.txt (Access is denied)
if you want to access files outside the server.

Apache PDF digital signatures

I have a website with a directory listing of all the pdf files which I have uploaded via ftp. By clicking any of the file names, the pdf document will show up in your web browser. Is it possible for outside parties to digitally signed the document in the web browser and save it back into the server with a appended "signed" on the file name.
My main problem is:
saving the signed document back into the server via the web browser
change the file name when the document is saved
It will depend on your permissions but if the user downloads it via http (you have directory listing enabled on your website) they should not be able to save it back to the site unless you allow it to be uploaded.
I would suggest reading the PHP upload tutorial.
You might consider WebDAV, but I would not recommend it.

Categories

Resources