A
A
Adamska2012-08-26 16:07:43
Google
Adamska, 2012-08-26 16:07:43

Is it possible to open a file upload confirmation window in Google Chrome?

Hello, friends!

There is a site. Programs (for example, exe-files) are downloaded from it. It is necessary that the user, when clicking on a link with a file, receive a request to save (Save / Cancel or something like this in other browsers). Google Chrome is missing a file download confirmation prompt. :( Is it possible to implement this somehow?

ps We are talking about a standard request.

Thank you.

Answer the question

In order to leave comments, you need to log in

12 answer(s)
A
avalak, 2012-08-26
@Adamska

Well, strictly speaking Chrome asks for confirmation when downloading certain types of files (exe, pdf, deb, etc).
As I understand it, the essence of the task is for the user to confirm his desire to download the file / accept the terms of use?
There is a standard confirm() dialog or you can make a modal window on js.
Or do you need something like hotlink protection? So that a confirmation window appears when accessing a file on the server and not necessarily from the site.

A
asm0dey, 2012-08-26
@asm0dey

I understand that what I will offer now is old school and overkill, but you can make a Java Applet that will ask where to save the file, and then download it yourself.

W
wersoo, 2012-08-26
@wersoo

Chrome has a download behavior setting:
image
And by default, the dialog box is disabled and, as far as I understand, it is impossible to find out the status of this item on the client. On the other hand, most often people have it disabled deliberately and there is no need to override what the user himself has chosen. Moreover, by stupidly hardcoding such a solution for chrome, you doom people with a non-default setting to a double dialog box.

A
Adamska, 2012-08-27
@Adamska

I tried to solve the problem with a notification, but Chromium sometimes gives an additional message in such windows: "Prevent the creation of additional windows on this page" with a checkmark.

E
Eugene, 2012-08-29
@Methos

onclick="return confirm('Do you want to download?');"

P
Prototik, 2012-08-26
@Prototik

And why should he? The file is downloaded immediately - if you need to open it, then right in the process of downloading you can click on it, it will open.
I have always disliked these dialogues, they distract from more important things.

A
agranom555, 2012-08-26
@agranom555

Well, there seems to be only one. Prompts you to specify where to save the file. Accordingly, there you can click cancel and do not download. Unfortunately there is no other

A
Adamska, 2012-08-26
@Adamska

In general, the task is as follows: it is necessary that the user must confirm the download of the file. In all browsers except Chrome, this confirmation is in the form of a Save / Cancel dialog. That's why I thought that maybe there is some way to ask the browser to give such a dialog (Save as ...).
Personally, only this way came to my mind: to identify the user by Webkit and give him a link with a JS window instead of a direct link, in which there will already be a direct link. But these are some kind of crutches :((((((((

F
freeek, 2012-08-26
@freeek

So you can do that, if the browser is Chrome, then display some jQuery dialog with confirmation and only then the standard browser window. Not an option?

N
Nazar Mokrinsky, 2012-08-26
@nazarpc

Serve the file with a script, sending a header:
Content-Disposition: attachment; filename="your_file.zip"
You can also specify the file type with a header:
Content-Type: application/zip
This will force the save / open file dialog box.

N
Nikolai Turnaviotov, 2012-08-26
@foxmuldercp

There is a list of extensions for which there is a mandatory request - executable, for example.
The window on the javascript - well, the toad script can be turned off, and here you won’t know anything either - I don’t know if the presence of a toad is written in the headings.
Of the options, in general html5, a flash loader to provide for all possible window options.

T
TheMengzor, 2012-08-29
@TheMengzor

Safari doesn't ask either, it downloads right away and it's super-mega-duper convenient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question