Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Downloading files

Posted on 2012-12-23
1
Medium Priority
?
308 Views
Last Modified: 2012-12-25
I download files usually from somewhere like Page21.aspx.vb  and I use the code given in the attached snippet.

targetname is sergyu-Screed.pdf

I am trying to run this from ClassC which is in App_Code and it's not working.

It is giving an error message saying "object variable not set".

Since moving code to App_code I seem to have problems with "response" and "cache"; they seem more often to throw up errors which I can sometimes resolve and sometimes not. These did not give problems when they were on regular pages like .aspx.vb.

Writing System.Web.HttpContext.response does not work.
DownLd.txt
0
Comment
Question by:Mazzarino
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
JustAndrei earned 1500 total points
ID: 38717535
You have not initialized variable response. Instead of Nothing it shoud be initialized with HttpContext.Current.Response.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

721 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