I use fileInput to upload one file which contains the paths and file names of multiple files on my local computer.
I would then like to use these file paths and upload them to the server directly without the user having to perform any more interaction.
So simply put how do I upload a file to the shiny server I already know its local path?
Related
I have a created a website which allows users to login by giving user name and password..Now i want to make an option which will allow the file from local machine to upload to a server.How can i do this?
Follow documentation on File Uploads
I want to save a file to a network server. Currently, I need to first save it locally, and then copy it to the server. The server supports ssh and ftp.
I would like instead to operate all directories and files in my GUI as if they were local paths, as follows:
Connect to the server, using ssh or ftp or tftp.
Then I click the get file button.
A FileDialog shows, displaying a drop-down list of all servers, while also including the local path.
When I choose a server, then list the server's directory, I can operate it as a local directory.
I know I can use QFileDialog in my QT project to open a file from local disk or save it, but can it do this?
Is there any way, when saving a file, to choose either to put it in the server or the local directory?
I want users to upload their themes containing .css, .js files to my server in zip format, Once they will upload the application will unzip it and the user will be able to see the theme at mysite.com/themes/user/. I want to know what security issues can occur if I allow user to upload .css and js files to my server. Can the malicious code redirect the site or do DOS service attack or change the dynamic aspects on my site. Scanning the files for malicious code before unzipping seems impractical. What safeguards should I take.
First and foremost, don't unzip them into a public "temp" folder while you're doing whatever else you're going to do with them.
There's no telling what that ZIP file will actually contain.
There's no telling what those JS files will try to do to your site.
You should read what Samy did to MySpace before you implement this functionality. (A breakdown of the attack.)
I am using a forms.FileField to have the user choose file to open. I need to know which path the user chose in addition to the filename. I can't seem to find that anyplace. I will be loading other files from the same path.
The path on the client (the user's computer) is not sent.
You cannot load files from the same path - unless you have some client side code (like a java applet or flash application) that has proper security permissions to open files on the client's computer, then send the files to your server over a TCP connection - which you don't.
So in summary, the file path on the client's computer is not available when using file upload fields, using any server side language.
For more information:
RFC 2388 (the specification)
How to get the file path from html input form
W3C Form Reference
I'm currently using django. And now I need to save a file uploaded by a user to another server which is not the one that serves the django application. The file will be saved to file system not the database. Could somebody tell me how to do this?
Default Django behavior is to save file on the filesystem, not the database itself).
You have several options how to do this, the simplest one is to have a filesystem exported from you "other" machine and mounted on the machine with the django application.
For the filesystem export you can use NFS, MogileFS or GlusterFS (which I'm using) or many more :). If you do not need real-time save&serve, simple rsync may be an option too.
Second option is to utilize existing django mechanisms StogareAPI. There are already available different storage backeds you can use and may be helpful for you (e.g. ftp).
This wont work out of the box, you need to have a mechanism(write some code) to queue the files that are uploaded through django application, then use a middleware(can be in python) to transfer files from queue to your file server. so flow is basically like this:
Accept the uploaded file via django app.
django app. writes the file info(its temporary path and name) to a queue
A middleware app reads the next file in queue.
The middleware app use some transfering protocol(sftp, scp, ftp, http etc...) to copy the file to file server.
Middleware app deletes the file from where django app is hosted so django server dont have a copy of the file.