Download multible files with JavaScript(one Download) - javascript

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.

Related

Can I change or upload a file in the directory of my html-file?

So I have the following situation:
There is an HTML file in some directory on my PC. If I open this HTML file in a browser, I want to click a button with which I can write or change a file in the same directory.
So there is no server whatsoever, just an HTML file opened in a browser.
Is this possible?
Calling a python script from a button would also work for me.
I just have to be able to detect a change in the directory when the button is clicked.
TL;DR
Yes it is. but there is additional system like git. and you need to implement using javascript.
Not a solution
I am sorry about I can not provide exact solution about your question. but I can give you keywords. I assume you do not know about git.
I recommend implement local git system for your local directory. because there is lot of changes your files. (like edit single character or add new files) and some of files you do not want detected (that's mentioned in .gitignore)
and there is suitable project for you isomorphic-git
. and If you heard about git first, also check github guide.

How to restrict download of js files in a website?

I developed a website using html and javascript. All my logic lies in javascript files. So I want to secure my javascript files being download when the user directly enters the url. Is it possible to restrict?
A javascript file is always downloaded by the client because the client has to be able to execute the code inside. The best thing you can do is obfuscate the javascript code.
Sadly there isn't a definite way to stop people downloading the JS files, CSS files or image files from your website as these are executed within the browser, the best you can do is to try and minify or obfuscate the files in such a way that they become near impossible to read and therefore use or copy.
A great example of obfuscating would be this: http://javascriptobfuscator.com/
A great example of minifying would be this: http://jscompress.com/
Trying using both for to make sure that there is little to no chance of the code being readable to nosey people.
If you restrict it from being downloaded, it is pretty hard for it to be downloaded by the browser to use it. :)
You can look into packing it:
http://dean.edwards.name/packer/
It will not make it secure, but will make people look the other way if they are too lazy to undo it.
A javascript file is always can downloaded by the client .reason the client has to be able to execute the code insidein web
u can try using .htaccess like:
<Files ~ "(.js|.css)">
Order allow,deny
Deny from all
</Files>
How to restrict/forbid access to specific file types such as .js .css inside a .htaccess file?

Python http server uploading multiple files

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.

zimbra zimlet to upload files in a briefcase folder from backend

I am creating a zimlet using js to generate a tree folder structure, but I also need it to include some files (default ones that are on the server). The problem is that I can't find a way to do this without asking the user to select the files manually. Any help on this?
You should check the zimbra soap which is realy helpful to you. I think you get the soap which upload the file in brifcase folder.

How can i display the merged contents of local files from a js+html page running locally

I have a bunch of files(not necessarily text files) on disk. I need to display the merged contents of all these files in a html page opened locally on Load. Is this possible without using Active-X? My objective is to create a summary of a set of files and at the same time to keep the summary file small. Infact most of the files whose data I need to summarize are html files.
If this is possible can I also choose only certain sections of text in each file to be part of the summary?
It would be great if the solution would have a wide browser support.
Any example would help a lot.
Thanks.
Open the files in iframes then pull the source of each and process it. Since it is coming from your own machine, there should not be any cross-domain problem.
Javascript does not have access to the clients file system, therefore I do not believe this is possible. See this post: Local file access with javascript

Categories