Make client download and save files without showing file dialog box

Hi,

How can i send data or file to client and force it to automatically
download and save it in specified folder without showing file dialog
box (Open / Save option) ?

Thanks in advance for your help.

On 11 March 2011 15:22, gs84 [email protected] wrote:

Hi,

How can i send data or file to client and force it to automatically
download and save it in specified folder without showing file dialog
box (Open / Save option) ?

I hope you can’t. It would be a serious browser security flaw if you
could. Would you want a web page downloading and saving files onto
your PC without your knowledge?

Colin

On 11 March 2011 15:22, gs84 [email protected] wrote:

How can i send data or file to client and force it to automatically
download and save it in specified folder without showing file dialog
box (Open / Save option) ?

By writing a web browser that breaks all standards and conventions,
then tricking loads of people into installing it…

c’mon… internet 101…

On Mar 11, 2011, at 10:22 AM, gs84 wrote:

Hi,

How can i send data or file to client and force it to automatically
download and save it in specified folder without showing file dialog
box (Open / Save option) ?

Thanks in advance for your help.

Browsers don’t work that way, for very excellent reasons of security
and not wanting to be hacked.

Walter

On Mar 14, 10:59am, gs84 [email protected] wrote:

Thanks to all for your answer.
Can you suggest me another process to face this problem?

What’s the wider problem you’re trying to solve?

Fred

Thanks to all for your answer.
Can you suggest me another process to face this problem?

Thanks.

On 14 mar, 12:48, Frederick C. [email protected] wrote:

On Mar 14, 10:59am, gs84 [email protected] wrote:> Thanks to all for your
answer.

Can you suggest me another process to face this problem?

What’s the wider problem you’re trying to solve?

Fred

I want to send file/data to user without showing the file dialog box.

Thanks.

On 14 March 2011 16:00, gs84 [email protected] wrote:

On 14 mar, 12:48, Frederick C. [email protected] wrote:

What’s the wider problem you’re trying to solve?

Fred

I want to send file/data to user without showing the file dialog box.

So what you are saying is that you want to use a web page to install
malware on a users computer?

Why would you want to do this and why do you think anyone here is
going to help you?

On Mar 14, 2011, at 12:00 PM, gs84 wrote:

I want to send file/data to user without showing the file dialog box.

Thanks.

Is this file data something which the user’s browser understands how
to process and display? If so, you could try just linking to it. Don’t
try to tell the browser what to do with it, just leave it up to the
browser. If the browser understands it and can display it, then it
will. If it doesn’t, then it will prompt for a save or a hand-off to a
helper application.

This is basic browser behavior as codified in Mosaic in the mid-90s,
and hasn’t changed at all since then. The list of things browsers
understand natively HAS gotten longer since then, but the premise –
that it’s up to the browser what to do with whatever you link to – is
the same.

Walter

What I meant was what are you trying to do that means you have this need?

Fred

In my application, while user’s registration i am creating a file
which users have to save, because that file will be use for their
authentication.
And may be for elderly people, showing dialog box and ask them to
choose path for saving that file could ne complicated for them.
That’s why i want to save that file in specified path without showing
the file dialog box.

Thanks.

On 14 Mar 2011, at 16:00, gs84 [email protected] wrote:

I want to send file/data to user without showing the file dialog box.

What I meant was what are you trying to do that means you have this
need?

Fred

On 15 March 2011 10:00, gs84 [email protected] wrote:

What’s the wider problem you’re trying to solve?

And may be for elderly people, showing dialog box and ask them to
choose path for saving that file could ne complicated for them.
That’s why i want to save that file in specified path without showing
the file dialog box.

That’s a very nice intention; to be worrying about the needs of the
users, but you should be able to see that if such a process was
possible, those self same easily confused elderly people would quickly
become targets of malicious downloads. If nice people can download
files quietly in the background, without the user knowing, then so can
nasty people.

In my application, while user’s registration i am creating a file
which users have to save, because that file will be use for their
authentication.

Can you not store what you need in a cookie?

Can you not store what you need in a cookie?

No. I can’t because user has to use it for every authentication.

So as this is not possible, is there a way to change (message, …)
the file dialog box in Rails?
Thanks

On 21 Mar 2011, at 16:42, gs84 wrote:

So as this is not possible, is there a way to change (message, …)
the file dialog box in Rails?

It’s a browser thing, so no. Rails, PHP, Java, the Pope, none of them
can change something that’s just part of how the browser itself was
programmed.

Best regards

Peter De Berdt

On 15 March 2011 12:08, gs84 [email protected] wrote:

Can you not store what you need in a cookie?

No. I can’t because user has to use it for every authentication.

What is the user supposed to do with it? They won’t even know it’s
there in your design.

So what if someone who can get hold of that file, can they masquerade
as the user?

On 22 March 2011 14:36, Peter [email protected] wrote:

On Mar 21, 11:30am, Peter De Berdt [email protected] wrote:

It’s a browser thing, so no. Rails, PHP, Java, the Pope, none of them
can change something that’s just part of how the browser itself was
programmed.

Related question that I’m interested in but might also help the OP: Is
there a way to control what type of files the dialog box is looking
for and/or where they start looking? I can’t seem to remember if I’ve
seen any sites do this, but its common if the file you want them to
find has a certain extension or type that will help narrow it down.

We are talking about downloading files here, so the browser dialog
box is not looking for a type of file at all, just asking whether and
where to save the downloaded file. It is up to the browser and its
configuration which directory to start at.

Colin

On Mar 21, 11:30am, Peter De Berdt [email protected] wrote:

It’s a browser thing, so no. Rails, PHP, Java, the Pope, none of them
can change something that’s just part of how the browser itself was
programmed.

Related question that I’m interested in but might also help the OP: Is
there a way to control what type of files the dialog box is looking
for and/or where they start looking? I can’t seem to remember if I’ve
seen any sites do this, but its common if the file you want them to
find has a certain extension or type that will help narrow it down.

Thanks,
\Peter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs