I'm using the simplehttpwithupload.py script, which I have linked to below, to host a simple http server where people can upload files to me. Is there a way to modify the source code so that multiple files can be selected for upload at once? Such that when the select file dialog box comes up, users can ctrl/shift click and select several files which will then be uploaded.
https://www.dropbox.com/s/wshzyseignnz78x/simplehttpwithupload.py
Thanks
Is there a way to modify the source code so that multiple files can be selected for upload at once? Such that when the select file dialog box comes up, users can ctrl/shift click and select several files
I'm pretty sure there's not a simple way. Things may have improved, but when I looked into this a year or two ago, the only solution for exactly what you're looking for is Flash based. The problem is that the file selection dialog is on the client side and multiple file selection is not directly supported in the browser.
There is a JavaScript based solution for downloading multiple files, but it doesn't exactly match what you asked for. See Upload multiple files with a single file element for the explanation, and Multiple file uploader: Mootools version for a later, prettier version.
The main idea is:
you can only store file upload information in a file upload element (), you’ll always need to have one element per file to be uploaded.
it’s actually a relatively simple matter to conceal a file element once a file has been chosen, and add a new (empty) one in its place.
To apply the JavaScript solution to simplehttpwithupload.py, you'll have to rewrite the list_directory function.
Related
is there a way to change the list of files in the file upload window using js? I know there is another thread here talking about that, but it doesn't answer my question as it's using plugins, whereas I'd like to know if it's possible to do it without plugin. In the browser I'm using the accept attribute already so the files displayed when you hit "Browse" are already filtered but I want to change the list of files in the drop down menu and have, in addition to All files, the other files included as values of the accept property. Is this possible with no plugin?
thanks
I am not sure if what I am asking is actually possible but let me try to explain. I am trying to allow users to link to a local file, from an internal web application. Instead of having to hard code every link, I was wondering if it was possible to manipulate a HTML file input so that the user could browse to the file they wanted to link to. I do not wish for the files to actually be uploaded anywhere since they are already on a local drive, it seems silly to duplicate them, and down the line this would lead to multiple duplications (the PDF's are per product, and the same product will be referenced on multiple occasions).
I am aware after some research that due to security reasons you are not able to obtain the file path of a selected file unless perhaps by the use of a temporary URL. See here. Unfortunately this seems to be a very temperamental solution and I can't seem to wrap my head around how it works.
I have spent a considerable amount of time googling this and was hoping someone on here had a reference or starting point I could expound upon.
I am looking for a javascript/jquery AutoComplete script which has the source being the file Names inside of a directory. I welcome any suggestions... thanks!
If worse comes to worse, I can just use an AutoComplete script (jqueryui or typahead.js) which has a source file for the results, but then I would have to code a separate function to automatically write to that file each time a new file is put into the directory or is deleted from it, and I am just trying to avoid that should something already exists.
EDIT server side scripting is unfortunately not an option for me. This is being run through an HTML Applications (HTA) file, so fortunately I do have additional freedoms than a typical web application.
I found an article for autocomplete textbox using jsp, jquery has been used but the code is written in such a way the data is retrieved from database and it comes as a suggestion when user types a letter or part of word.
if you are looking for it, you can click it here
What i want to do is to be able to select multiple files using the multiple attribute on tag but when starting to upload ( POST) each files will be uploaded individually + having the possibility to remove a file from the queue(this is what makes things even much harder, because adding files is not a problem since i can easily create another element but removing is impossible).
Now for security reasons its impossible to alter a file tag in html! so far what i have done is having a single file input and when selecting a file, a new element is created in its place so i am giving the illusion of a queue and then using jquery i upload each file individually! ( cant select multiple files at once but everything works)
I have found some flash plugins but i don't want to depend on more libraries, if it was a simple flash file no problem but most of those plugins need additional js files etc...
I would be happy to see a cross-browser solution. Again i know there are some flash plugins that can do this, but i am after a cleaner and simpler way maybe a single swf file or something ....
Thanks
Im pretty sure uploadify does all of this, and in a single simple small swf.
I generate a HTML page with VB.Net which stores several pinks to files. These links are formatted with JavaScript looking like the Windows-Explorer with folders and files. The problem: There are only download links for the files, not for Folders. A folder can contain Subfolders ,a List of Files or a combination of both. So if I want to download a folder, I have to click manually on every file-link. I have not the possibility to insert PHP or another Server-side language.
my question now is:
Is there a client side way to Download them by click on a Folder? I prefer Javascript but If it isn't possible Flash will be ok also.
What you could do is, link the folders to a special ASPX file. In this file, just create a ZIP with all the files inside it, and make the browser download that ZIP file. I think it's the easy way to accomplish what you are trying to.
With Javascript you could open several windows, one with each file downloaded. But I don't think it will please your users.
There is no way in Javascript and as far as I can tell, theres no way to do it in Flash either. A server-side zip is going to be your only way.