hello,

Current scenario: When user downloads file from web browser having extension .zip or .rar the user is prompted with save dialog.

Requirement: When user downloads file having .zip or .rar extension the we browser should not prompt for the save dialog but rather open the file directly in winzip or winrar.

Is there any way i can acheive this without using the third party tool???

No.

You are asking for the ability to commit security violations. Whoever wants this capability needs a course in internet security.

The browser is not allowed to run any downloaded file for security reasons. The browser is also not allowed to unzip the file, since the file could install malware while being unzipped. This is a matter of security, and is also a matter of LAW in many nations, including the US.

The user has the RIGHT to scan all downloaded files for malware before unzipping and running them manually.

The website being browsed has NO RIGHT to install or run downloaded software on the user's computer, without the express PERMISSION of the user.

The browser also might not know how to display the file, since the file type is not known at the time of download. The instructions of what kind of file to create when unzipping are hidden inside the .zip file.

The unzipping function also must use a disk file, not an Internet file. With some compression methods, the software must make multiple passes through the file.

Thank you for the explanation.

Another problem that i am facing is, in our application we have zip, rar files stored in the database. When i try to download these files on my machine it asks for saving. Servlet is used to download these files. The content type set is application/zip and application/rar for zip and rar files respectively. But when i save these files on my machine they get saved by .jsp extension. I have winzip and winrar software installed on my machine.
Where should the problem lie???

@Midi magic

he browser is not allowed to run any downloaded file for security reasons. The browser is also not allowed to unzip the file, since the file could install malware while being unzipped. This is a matter of security, and is also a matter of LAW in many nations, including the US.

hey aren't you going too far , this isn't that complicated as you are making it sound ... i use Mozilla firefox and it opens and runs all the files.

I am little bit confused. I am using IE browser and for saving file i am using filechooser component of java. When i save the .doc file using file chooser the extension shown while saving is .doc and file type is selected automatically as Microsoft Word Document. This is working fine. But when i try to save file having .zip or .rar extension the file chooser show the extension as .jsp and file type is .jsp document. I have to externally set the extension to .zip or .rar and then open the downloaded file.

Is there any way for these file formats .zip and .rar the extension are automatically set in file chooser rather than manually changing it?

Also i checked it with mozilla firefox and netscape. There doing some browser setting i can open these file formats without any problem.

I am little bit confused. I am using IE browser. When i save the .doc file using save dialog the extension shown while saving is .doc and file type is selected automatically as Microsoft Word Document. This is working fine. But when i try to save file having .zip or .rar extension the save dialog show the extension as .jsp and file type is .jsp document. I have to externally set the extension to .zip or .rar and then open the downloaded file.

Is there any way for these file formats .zip and .rar the extension are automatically set in save dialog rather than manually changing it?

Also i checked it with mozilla firefox and netscape. There doing some browser setting i can open these file formats without any problem.

The setting you are making turns off the security that prevents malware on sneaky sites from running itself on your computer. You should not make that setting.

Check to see if the .zip and .rar extensions are in the file types list in My Computer. This is what tells applications what extensions are valid and what program to open files of that type with.

The setting you are making turns off the security that prevents malware on sneaky sites from running itself on your computer. You should not make that setting.

Check to see if the .zip and .rar extensions are in the file types list in My Computer. This is what tells applications what extensions are valid and what program to open files of that type with.

I checked the file types present on My Computer. I went to 'Settings'->'Control Panel'->'Folder Options'->'File Type' tab. The entries are present for .zip and .rar file type. Still these file types are not recognized by the computer :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.