473,669 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pdf dowload

Hello all,
i have a asp.net c# web app 2.0

I have a pdf generation with a third part sw, but i cant download pdf in a
new window, from a folder inside my web site.
The code i try to use is this:
...pdf Generation..

Response.Clear( );
Response.Conten tType = "applicatio n/pdf";
HttpContext.Cur rent.Response.A ddHeader("conte nt-disposition", "attachment ;
filename=test.p df");
Response.Transm itFile(@"c:\\.. .path..test.pdf ");

pdf tell me that cannot find the file or is corrupt. I tryed the option
inline instead of attachment but nothing changed.

Anyone have some help? Thanks a lot
Jul 31 '06 #1
2 1491
r u getting this error on server side or on client side when user tries to
open the downloaded content.

"comick" <co****@discuss ions.microsoft. comwrote in message
news:DE******** *************** ***********@mic rosoft.com...
Hello all,
i have a asp.net c# web app 2.0

I have a pdf generation with a third part sw, but i cant download pdf in a
new window, from a folder inside my web site.
The code i try to use is this:
..pdf Generation..

Response.Clear( );
Response.Conten tType = "applicatio n/pdf";
HttpContext.Cur rent.Response.A ddHeader("conte nt-disposition", "attachment ;
filename=test.p df");
Response.Transm itFile(@"c:\\.. .path..test.pdf ");

pdf tell me that cannot find the file or is corrupt. I tryed the option
inline instead of attachment but nothing changed.

Anyone have some help? Thanks a lot

Jul 31 '06 #2
Thnks for responding...
I passed by opening a new window and then open the pdf directly in that
window...so the dialog mode OPEN/SAVE/CANCEL doesen't appear, but it work
fine.
This is the code:
ASPX
<script language="vbscr ipt" type="text/vbscript">
sub NewWindow()
window.open("PD F.aspx")
end sub
</script>
<input type="button" onclick="NewWin dow()" class="button"
causesvalidatio n="false" value="Dowload"/>

C# code behind
protected void Page_Load(objec t sender, EventArgs e)
{
Response.Conten tType = "applicatio n/pdf";
Response.Clear( );
Response.Transm itFile(PATH...) ;
Response.End();
}

"Winista" wrote:
r u getting this error on server side or on client side when user tries to
open the downloaded content.

"comick" <co****@discuss ions.microsoft. comwrote in message
news:DE******** *************** ***********@mic rosoft.com...
Hello all,
i have a asp.net c# web app 2.0

I have a pdf generation with a third part sw, but i cant download pdf in a
new window, from a folder inside my web site.
The code i try to use is this:
..pdf Generation..

Response.Clear( );
Response.Conten tType = "applicatio n/pdf";
HttpContext.Cur rent.Response.A ddHeader("conte nt-disposition", "attachment ;
filename=test.p df");
Response.Transm itFile(@"c:\\.. .path..test.pdf ");

pdf tell me that cannot find the file or is corrupt. I tryed the option
inline instead of attachment but nothing changed.

Anyone have some help? Thanks a lot


Aug 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2216
by: igthibau | last post by:
Hello everyone, well, the title says pretty much all. First off though I'd like to say I have no idea what ng I should post this to. I chose this one because I am more likely to understand c-based answers than other language's. So, my problem is simple : to submit a query to a search engine, one goes to , say www.google.com, enters keywords and a long list appears. Then one clicks onto the appropriate hyperlink to go to the chosen site....
13
1905
by: dvsbis | last post by:
does anybody have example of file download using java script thanks dave dvs_bis@sbcglobal.net
0
1043
by: djordje | last post by:
I am a member of usenet acess.com and would like to know if it is possible to download hd movies!! ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
3
1135
by: Jerry Camel | last post by:
How do you tell the client how large the file that's being downloaded is? I've seen web sites where the download dialog shows a progress meter. I'm assuming that the server is sending the file size prior to download. Maybe in the "Content-Disposition" header? Thanks. Jerry
2
2512
by: marcos | last post by:
sorry, but my english are very bad... how lto dowload visual basic 6.0 from internet?
4
1174
by: Albano Alves | last post by:
Hi! How can I force the file download, for example a .doc? I don't want to open with IE. Thanks. Albano Alves
6
414
by: rony_16 | last post by:
Hi, I have problem with downloading a file using WebRequest and HttpWebResponse. Inorder to download this file i need to call to url that tells to prepare the file for download, and then i call to another url that downloads the file. I have a problem with that because: 1. i do not know when the server finished the preparetion. 2.i checked the HttpStatusCode but he doen't changes
1
1785
by: nkamalnath | last post by:
hi, How to dowload a file using javascript.
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.