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  |  

PortalWebHosting
  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

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
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
 


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.

 


EMAS Pro
Strategic Enrollment Management Software for Higher Education Recruitment, Retention and Financial Aid
www.emaspro.com
Subzero Solutions
Dutch / English DotNetNuke consultancy services. Custom module development in any version. Complete application integration. Small business portal hosting. Your ideas our innovation - Your success our motivation. K.v.k Amsterdam: 34236342
www.subzero-solutions.net
Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com

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