简体   繁体   中英

Can JavaScript be used to push a file to another machine or web service

I'm relatively new to this

We have a requirement to save a file with out the use of the dialog box. I was wondering if I can use AJAX or some other JavaScript to "Push" the file from the client PC being viewed in a browser to to some web service the client is running and have it save the file.

Do I get into cross site scripting issues or an issue I don't know about at present?

Thanks

With valums uploader script, users can drag and drop files (in certain browsers) to a button on the page.. so, yes, no dialog box, but it still requires user interaction. (I also know IE10 should be able to handle drag/drop functionality from one of their demos; so this kind of functionality is gaining ground).

I don't think you can upload a file without a dialog box. That would remove the user interaction, so it would be the same thing as allowing a webpage to select any file it wanted and upload it without user interaction - an obvious security flaw.

Generally, without a dialog box, no it can't be done.

HTML5 has a file API where the web app can store files on the local machine. But this access to the filesystem is sandboxed, so you get to access files only under your directory.

Why can't you do without a dialog box? Imagine you visit some site and it "uploads" files without your permission. That's a security FAIL . The dialog box is the user's authentication for the file to be uploaded.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM