473,226 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

XMLHttpRequest / JavaScript to download files from server to local

2
I am looking for an isolated piece of code that uses XmlHttpRequest/JavaScript to download files from a (specified path on a) server to local machine. The browser on the local machine (Mozilla/FireFox) does not require user interaction.
Oct 18 '08 #1
4 15440
Atli
5,058 Expert 4TB
So you want your browser to download files and save them to the hard drive on your clients computer? And to top that, you want to do this without the user even being aware of it?

If so, then no mate. Never going to happen.

Could you imagine what would happen if web-developers could simply save stuff on your computer without you agreeing to it or even being aware of it? No computer connected to the internet would survive for more than a day.

No browser will ever give your client-side scripts access to the file-system.
Oct 18 '08 #2
robain
2
So you want your browser to download files and save them to the hard drive on your clients computer? And to top that, you want to do this without the user even being aware of it?

If so, then no mate. Never going to happen.

Could you imagine what would happen if web-developers could simply save stuff on your computer without you agreeing to it or even being aware of it? No computer connected to the internet would survive for more than a day.

No browser will ever give your client-side scripts access to the file-system.
No, the device with the browser is not a client or customer machine, but a dedicated device to reproduce multimedia content. Basically its a media player. It is programmed not to require user interaction, as the only controller of the dedicated device is also the controller of the server. Can you not work with server sockets on both sides, so that the server always accepts requests from player and vice versa. The only thing missing then is still the code on how to do this (download file from server to player via HTTP).

Here goes some comment from the device/software manufacturer:

+++
There is a way to do that [..initiate download from player]. That way is a standard way for Mozilla (or Firefox) based browsers.

You can use TCP sockets in your JavaScript applications like you usually do in C or any other general purpose language. See http://www.xulplanet.com/tutorials/mozsdk/sockets.php

You even can use server sockets in JavaScript. See http://www.xulplanet.com/tutorials/m...serverpush.php

You also can access local file system. See http://developer.mozilla.org/en/Code.../File_I%2f%2fO

You can also take a look at Mozilla jslib http://jslib.mozdev.org/

All this code requires interaction with user to ask him if he allows to perform the operation. In our player-browser [Mozilla/Firefox] this interaction is not required.

All these operations are allowed by default.
+++
The thing is I am just not a programming expert, and want only to have the right code to execute this operation.

Thanks a lot.
Oct 18 '08 #3
rnd me
427 Expert 256MB
you can use flash for sockets.

you can load remote files into variables, but you cannot save them on the local machine.

although in firefox and IE8, you can store up to 5mb of data using window.globalStorage.

you can store 10mb w/o permission by tunneling into flash.
Oct 20 '08 #4
akarsh
3
I don't know that which server side technology you are using. But if u are trying it in PHP then at first you have to make a request to your server using XMLHttpRequest object and on the server end you have to read that file's content using readfile() function. Then you should set some headers like content-type, pragma and Cache-control etc and finally echo that content on your web page using PHP 'echo' .
Oct 22 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: scrimp | last post by:
Ive been using PAMIE 1.4 to try to automate web page processes. The one thing I cannot do with it is upload files and download files. With uploading files, the file input box does not allow PAMIE...
0
by: Sachit | last post by:
I am working on an BIT application to download files from remote server using C#, There are an issue related with performance, I am downloading 3 files 28Kb, 79KB, 121KB respectivly on my...
1
by: Matt Hamilton | last post by:
I was hoping that someone can give me step-by-step instructions to fix the following: We would like our ASP.NET application to utilize a central file server for uploads and downloads. I have...
2
by: Grant | last post by:
Hi, I'm trying to download files using asp.net (vb) and it seems to take forever to actually bring up the Save As dialog box. The files are Academic Software Downloads so are quite large in...
6
by: Michael Tissington | last post by:
I have setup up Forms Authentication on my website and added configuration/mappings for exe, pdf and zip files (using C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll) However when...
0
by: tanyali | last post by:
using php5, I download files : ******** downloadfile.php $fileContent = @mysql_result($result1,$i,"gdata"); ...
12
nathj
by: nathj | last post by:
Hi, I am working on a system, as you may have seen from my other posts, that allows members to download files. When they download a file I want to store the user ID and the file ID in a table...
1
by: samvb | last post by:
hi guys, i am lookin to creatin a local site. i want them to download files to thier local computer from the server. how can i do that? the server is ftp.
1
by: kishoreforqns | last post by:
how to download files (2mb>) using networkstream from a mailserver.. i can conenct to the mail server, list unread mails, and i can also retreive unread mails. but that till 1.5 mb. how to do...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.