.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

sending .ePub files to user

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
I need send to user e-book in file format .ePub. ePub file is zip archive with epub extension.  I try to send the file by Response object in C# code, bud all attempts cause a dialog box to open or save of file with zip extension. Example of code // dir and name are stirng variables with path and file name without extension zip.Save(dir + "epub.epub");      //save file to disk Response.Clear(); Response.ContentType = "application/octet-stream"; Response.AppendHeader("Content-disposition", "filename=" + name+".epub"); Response.WriteFile(dir + "epub.epub"); //Response.TransmitFile(dir+"epub.epub");  //the same behaviour   OR Response.Clear(); Response.ContentType = "application/octet-stream"; Response.AppendHeader("Content-disposition", "filename=" + name+".epub"); zip.Save(Response.OutputStream);   I need to offer files with extension epub.  Can somebody help? Thanx  

View Complete Post

More Related Resource Links

DIME: Sending Files, Attachments, and SOAP Messages Via Direct Internet Message Encapsulation


Direct Internet Message Encapsulation (DIME) is a new specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP. In this article, the author explains what DIME is and how it differs from MIME encapsulation. A detailed description of the message format and how it is parsed, as well as working with SOAP and extending it with WSDL, is also included.

Jeannine Hall Gailey

MSDN Magazine December 2002

what is the better design for location of system database data / log files and user data/log file,

is there a guideline for better performance for system database data location log location, like tempdb location etc. also better location for user databases/data and log.

Forms Authentication sending user to LoginURL on first hit of page even though page has [allow users

On the first hit, and only the first hit, to my page having [ALLOW users="*"] in the web.config, the user is redirected to the LoginUrl, but on all subsequent visits to the page, the user IS allowed access.  The user shoud ALWAYS be allowed access to this page.  I suspect it is a configuration problem, so here are snippets of my web.config... <compilation debug="false" strict="true" explicit="true" /> <trace enabled="false"/> <authentication mode="Forms"> <forms protection="All" cookieless="UseCookies" requireSSL="false" slidingExpiration="false" timeout="20" name="12345678-1234-1234-1234-123456789012" loginUrl="~/Web/Login.aspx" defaultUrl="~/Web/MyPage.aspx" enableCrossAppRedirects="false" /> <authentication> <httpCookies httpOnlyCookies="true" /> <sessionState cookieless="UseCookies" />         <location path="Web/Contact.aspx"> <system.web> <authorization> <allow users="*"/> <authorization> <system.web> <location>   Can you help me figure out why users are not ALWAYS allowed access to the /Web/Contact.aspx page? Thx!      

Sending .net project files in email

Hi all,How can I send my .net project file to somebody. Which all files do I need to send?

Need a good solution on how to allow a user to upload multiple files


Im currently working on a project where i have a form that users fill out in order to submit issues.
My ask is to give the user the ability to upload multiple files together with the form submission and also go back each time they have an update and upload more if they need.
The way i have it right now is that i only have one FileUpload Control and once the Save button is clicked the file is save in the database together with the form info.

 I already has a separate table for the files with reference to the ticket but im just not sure how can i allow the user to submit as many files as they want in an easy way.

Any ideas?

Multiple user access for files


Dears ,


I am building a web-application that uses xml files to send them to Web-Services , and the application will be used by alot of users i have the files in my directory , and before continueing development I was thinking about when several users will use the same xml file at the same time knowing that , the users will have to ( read , write ) on these files , so if one user is writing on the file and another one will read from it we will have a bit confilict here . Please advice urgently .



I thought of copying the whole xml file TEXT and placing it as a string in the application but if i have to use like 10 xml files this will be a big performance issue i guess.



Thank you.

how to allow user to navigate through subdirectories, select, and download files



I have been googling and reading for days but cannot find a way to  allow user to select from the contents of a number of subdirectories and download a file.  I've seen how to download a file from within one directory, as well as displaying the files in  a grid but I am unable to find a way to diplay the directory tree and allow the user to navigate to a subsirectory, select a file, and then download it.

I have version 2.0 of ASP.NET and I use VB.  Can someone point me in the right direction?


Getting data and sending it in a CSV file to user



I'm creating an ASP.NET application that needs to get data from database (time consuming) and show some indication (e.g. gif animation) that the application is doing something. After that the data should be send to user that the user can save or open the CSV file.

I'm able to do this with two button click's. One for getting the data from the database in codebehind and using javascript to show the gif animation for user in the meanwhile. Second to use the response.write(myData) and response.end() to send the data for user to save in CSV file.

The problem is that I need to do this with one button click. If I combine the code to one button click handler the data is sent correctly but the gif animation is not hidden because the page is not updated. How to do this correctly with one button click?

Thanks, Nitos

Sending emails to user from people picker - non-exchange user


Hi all another issue @ hand, our production environment is in co-existence between exchange and domino, mail flow is working fine between them as we do directory sync. now for the juicy part, when sending email notification from sharepoint, it users people picker to pick up users synced from AD. To Exchange users it goes through without issue, but to Domino users it does not, even though the AD account has the email field in account been tabulated. For Domino users we have AD account and Mail contact for mail fow. Can someone help me understand why is it so when even with the email field been tabulated in the AD accoutn for the Domino users, email notification does not go through, but when the email address of the users is hard-coded into the notification the email goes through.

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Choosing Between a User Control or Web Part for SharePoint

SharePoint will only display Web Parts on a page. However, there are publicly available shims that allow you to write user controls and have them be displayed as a Web Part. From SharePoint's point of view, the shim is a Web Part. From the point of view of the user control, the shim is simply a control in .NET that is including the user control

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

How to track the changes of user contacts(colleagues) by using SharePoint API

We might have seen colleague tracker web part which keep tracks the changes made in our contacts/colleagues details like profile/lists/sites. The same tracking mechanism can be implemented by using MOSS API in any custom web part/ web control/ feature/web service...

UserProfile.GetColleagueChanges is the method which returns all changes happened with the contacts, this method also accepts a Query (UserProfileChangeQuery) where we can specify different parameters to filter the changes

SharePoint document migration challenges when migrating files and folders

There are several challenges when migrating documents to Microsoft SharePoint. While these challenges can be overcome, they are a real pain if the migration source, content and file systems are not SharePoint friendly.

Combine, minify and compress JavaScript files to load ASP.NET pages faster

Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend