download resource client side

A

Alex K

Hello,

Would it be possible to make the browser download a resource using
javascript? I'm aware there could be a security issue but I'm still
wondering if this could be possible. It could save a lot of bandwidth
on the server side. Thank you.

Alex
 
D

David Dorward

Alex said:
Would it be possible to make the browser download a resource using
javascript?

Well, you could do something like:

location = "http://www.example.com/resources/";

Or did you mean "Save to the user's disk"? JS can't write to the local file
system in a typical browser security environment.
I'm aware there could be a security issue but I'm still
wondering if this could be possible. It could save a lot of bandwidth
on the server side.

How? The resource still gets downloaded. Perhaps you just need to look into
configuring your server to send different cache control headers?
 
A

Alex K

Well, you could do something like:

location = "http://www.example.com/resources/";

Or did you mean "Save to the user's disk"? JS can't write to the local file
system in a typical browser security environment.


How? The resource still gets downloaded. Perhaps you just need to look into
configuring your server to send different cache control headers?


Hi David,

Thank you for your response. Well I'd like to make a simple meta
search engine. Instead of having the server download and screen scrape
the results for a user query, I would rather like to do this process
entirely on the client side (to save bandwidth and to use the client's
ip address for the http request). So for example for a user query, I
would download google, yahoo and ask on the client side. Then
screenscrape the results and display them, all on the client side
using Javascript. I do not want to write to disk but rather to keep
the results html in memory.

Alex
 
D

David Dorward

Alex said:
So for example for a user query, I would download google, yahoo and ask on
the client side. Then screenscrape the results

Making HTTP requests to a different domain and then reading the results back
in JS is a security no-no.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top