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.

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

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

Walter

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

c'mon... internet 101...

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

Thanks.

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.

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, 10:59 am, gs84 <salimat...@gmail.com> 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.

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

On Mar 14, 10:59 am, gs84 <salimat...@gmail.com> 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.

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

Fred

>> On Mar 14, 10:59 am, gs84 <salimat...@gmail.com> 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.

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.

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.

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?

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

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

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

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