Solved

VB.NET bypass Open SaveAs Security Warning

Posted on 2009-07-09
3
315 Views
Last Modified: 2012-05-07
Hi there.  I have an app that goes to a webpage and downloads a file...however, the old
File Download - Security Warning "Do you want to open or save this file?" message pops up. Any ideas on how to bypass this and just save the document to a specified location?
0
Comment
Question by:suicehockey44
  • 2
3 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24821182
Point 1: Its not a security warning. It gives user the two options as you mentioned.
Now how do you download those files? Can you not use the My.Computer.Network.DownloadFile method to silently download the file?

http://www.mredkj.com/vbnet/downloadfile.html

http://www.devarticles.com/c/a/ASP.NET/HTTP-File-Download-Without-User-Interaction-Using-.NET/

http://www.vbdotnetheaven.com/UploadFile/bfarley/FileDownload04182005043858AM/FileDownload.aspx
0
 

Author Comment

by:suicehockey44
ID: 24822824
The file is hidden in a script.....The link is https://gats.pjm-eis.com/myModule/rpt/myrpt.asp?r=229
but the file is downloaded via

<script language="javascript">
            function downloadnow() {
                  frmDownload.submit ();
            }

I've tried using the invokescript method but it still requires me to select an option.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 24822889
I am not an expert of javascript but may be you could use some technique such as the SendKeys we use in VB.NET.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now