473,402 Members | 2,072 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,402 software developers and data experts.

download resource client side

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

Feb 11 '07 #1
3 1624
Alex K wrote:
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?

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 11 '07 #2
On Feb 11, 9:40 pm, David Dorward <dorw...@yahoo.comwrote:
Alex K wrote:
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?

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is

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

Feb 11 '07 #3
Alex K wrote:
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.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Feb 11 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: duane | last post by:
Dear Experts: I am trying to measure a HTML page download time on the client side and store the value into a textfile located in the server. I have successfully measured the page download time...
5
by: Simon Wigzell | last post by:
Allowing download of file types that will display in a browser is no problem, but how about files types that don't display? I would like my clients to be able to click on a link that will start a...
4
by: D. Alvarado | last post by:
Hello, I would like to design a page that measures the user's download connection. Does anyone have an example link or script that might aid me in this task? Thanks, - Dave
6
by: S P Arif Sahari Wibowo | last post by:
Hi! I am thinking to have a client-side script doing processing on file downloading, basically the script will process a downloaded file from the server before it received by the user. For...
6
by: Smugsboy | last post by:
Need some help. I would like to create in my site a picture that when a user clicks on it, a javascript code which determines which file is to be downloaded to the user, is ran. My problem is...
13
by: bmurphy | last post by:
Last week after much searching, I found the answer to my problem in this newsgroup. I can't find the thread from which I got my solution, but I wanted to report back what worked. When the site...
2
by: Jan Paul van de Berg | last post by:
I have a piece of software that people can download and a third party promoting that software. In order for them to be able to count the number of downloads, I have to put a tracking code on my...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.