Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Vote for DotNetNuke as your choice for winner of this year's PackT Open Source CMS Award
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Attachments Download Open Error In Log in Mode
Previous Previous
 
Next Next
New Post 8/29/2007 12:10 AM
User is offline hz_yang
11 posts
12
10th Ranked


Attachments Download Open Error In Log in Mode 

Hi, everybody.

I'm using database to store attachment for Load Balance considering, and I download my attachment using the following statment

                Dim Buffer As Byte() = CType(dr("Content"), Byte())
                Response.ContentType = CStr(dr("FileType"))
                Response.AddHeader("Content-Disposition", "attachment;filename=" & dr("FileName"))
                Response.BinaryWrite(Buffer)
                Response.Flush()
                Response.End()

 

It provide client user a dialog to Open or Save, I notice that when I click "Save" it works fine, but I click "Open" it cannot work(the application like notepad opens and cannot find the file)

 

But when I logout the DotNetNuke, the Open works well. It only don't work on Log in mode.

 

What's the problem, can anyon help? thanks a lot.

 
New Post 8/31/2007 3:47 AM
User is offline hz_yang
11 posts
12
10th Ranked


Re: Attachments Download Open Error In Log in Mode 

Can anybody help?

 
New Post 8/31/2007 7:41 AM
User is offline Vitaly Kozadayev
687 posts
www.continure.com
7th Ranked






Re: Attachments Download Open Error In Log in Mode 
Modified By Vitaly Kozadayev  on 8/31/2007 10:44:20 AM)

I use the code below in numerous apps and it works fine. Of course it's in C#, so you'l have to "re-write" it. "file_" is a class that I use to populate document info from DB. DocumentData is a byte[] - so it's the same as your Buffer assignment. Perhaps, the only notable difference is the Content-Length header assignment. And absense of Flush() call.

Response.Clear();
Response.ClearHeaders();

Response.AddHeader("Content-Disposition", "attachment; filename=\"" + file_.DocumentName + "\"");
Response.AddHeader("Content-Length", file_.DocumentData.Length.ToString());

Response.ContentType = file_.MIMEType;
Response.BinaryWrite(file_.DocumentData);
Response.End();


Vitaly Kozadayev
Principal
Viva Portals, L.L.C.
 
New Post 9/25/2007 7:16 AM
User is offline hz_yang
11 posts
12
10th Ranked


Re: Attachments Download Open Error In Log in Mode 

Thank vitkoz, and after I saw your reply, I'm doing my other project so have no time to try, and today I tried and ... IT WORKED!

I think it's the "attachment; filename=\"" works, thank you.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Attachments Download Open Error In Log in Mode
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Customer Connect
Customer Connect provides cutting edge solutions that deliver sales, marketing and customer service results.
www.customer-connect.com
TechNexxus
Business process and technology sourcing solutions delivering superior people, process and value. We have used, and continue to use, DNN successfully in numerous client projects to deliver exceptional value. We are proud to support the DNN team and community.
www.technexxus.com
PartnerPoint - Microsoft Technology Community
PartnerPoint is one of the largest online communities of Microsoft Partners Worldwide. With over 5,000 active members, it serves as a collaboration platform for other technology communties around the globe
www.partnerpoint.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP