.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

Reduce PDF size on upload to database

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

Hi all

I have an application that allows users to upload a pdf. I am saving the PDF into SQL (I know already this is not the best practice, but it was not my decision) and I need to some how duing this upload process reduce the size of the pdf. Is there a way to get the uploaded file, reduce its size, then stream it to SQL?

Thank you for any help


View Complete Post

More Related Resource Links

Reduce ASP.NET Page size and complexity using JQuery

This is my first post on asp.net blog. ASP.NET Ajax and JQuery are two different ajax framework. In this post I will show, how we can enhance gridview using ASP.NET Ajax and JQuery. I also compare the implementation of these frameworks. In next posts i will explain more about JQuery and ASP.NET Ajax and also tell you "How to combine the power of both framework". My Future post will related to ASP.NET and related frameworks.

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Reduce Image Size


How to reduce the image weight using asp.net, without lose of image quality and image pixels. For example i have an image with the size of 4 MB (3024*2045), so how to reduce the image weight ie 4 MB to 1 MB without lose quality in the same pixels ie(3024 * 2045) using asp.net.

Insert Excel Data via File Upload into sql server database???

Hi all, I have requirement that User can Upload the Excel Sheet Data to sql server Database at once. How i do that Any Article or hint is apperciated.   Regards 

XML size cost to a database

I am in the process of integrating a procedure that imports data into an xml format. The question I have what is the cost on disk versus just importing each colunm. Say I have 10 columns of data, how much more space does an xml column take than just 10 individual columns with the same data. I have searched everywhere and I can not find a definite answer that addresses this question. Any help is greaty appreciated.

Reduce sysdtslog90 size

Hi my sysdtslog90 table has grown massivly in size. Is it safe to just delete the unwanted rows form this table using the normal delete command ?

Database Mail configuring the maximum mail size (not attachment 'MaxFileSize')

Hi can anyone tell me if it's possible to configure the maximum size of an email when using database mail?  I know it's possible to use sysmail_configure_sp to set 'MaxFileSize', I want to prevent an email being sent the size of the body of the email is very large. In my case the body is based on a query result set inserted as html. Thanks      

calculating the size required for backup of database

Hi, How to calculate the size required to take backup of a database in mssql 2000.the results returned by sp_spaceused differ too much from the actual size taken on the disk. Thanks in advance

database size limit about SQL Server 2005 Express

I know that there is a size limit (4 GB) for SQL Server 2005 Express, but I am not quite sure if the limit is applied for only ONE database data file or for ALL the database data, suppose I have two databases DB1 and DB2, so which of the following statement is correct? A. The size limit for DB1 is 4GB, and the size limit for DB2 is also 4GB, so if DB1 is 3G and DB2 is 3.5G,that will be OK. B. The total size for both DB1 and DB2 can not be larger than 4GB, which means if DB1 is 3G, then DB2 can not be large than 1G.

Upload image to database - couldn't find file path

I'm trying to display images in a GridView (yes, still this...). [edit] Before I can come to that I have to upload some images to the database.I've followed this tutorial for the "upload image to database" code (this worked fine for uploading images, but I don't know if the images were converted to byte):http://aspsnippets.com/Articles/Save-Files-to-SQL-Server-Database-using-FileUpload-Control.aspxand I've followed this tutorial for the "display images in gridview" code (and "retrieve file" from the tutorial below).http://www.aspsnippets.com/Articles/Display-images-from-SQL-Server-Database-in-ASP.Net-GridView-control.aspxIt doesn't quite work, the GridView shows but without imagesNow I'm trying to change the "save file" code according to this tutorial:http://aspsnippets.com/Articles/Save-and-Retrieve-Files-from-SQL-Server-Database-using-ASP.Net.aspxbut I don't understand everything in it. When I try to upload an image I get an error on this line:FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); //couldn't find file (path to image I tried to upload) What should I do about it?

Sharepoint Database size question

We have just installed Sharepoint 2010 in our network.  We currently have 2 users who are accessing the system, since we are in alpha stage.  What I have noticed is that  User Profile Service Application_SyncDB database size is at 800mb.  is this normal? In addtion, WSS_Logging database size is at 140mb. 

How can I reduce the .sql file size?

The program in our office has program called eSRE. My Database server is called Wamp Server. In Wamp Server there is a MySql 5.0. MySql is my Database. Now, I already encode a lot of records in my database. When my computer encounter an error, I backed up my database and has named of lgusresystem.sql with 3,895KB. Now, after I reprogrammed my computer and reinstalled the said program, I imported such backed up database file (lgusresystem.sql) into a MySql Server but the computer prompt a message like this "No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration". Here in MySql Server, I can see here that the maximum file to be imported is only 2,048KiB. So, what am I going to do so that I can restore my latest records in my database? I hope you will give an appropriate immediate action on this matter. Thank you very much.   JEFFREY R. DAWATON from Philippines  

Upload file to server or database

hi,I'd like to know how to allow user to upload file to the server in mvc 2 application. I haven't seen a very clear tutorial for this, at least not on this website. There is a movie database tutorial but that is simply a list of movies not actual files. What is the simplest method for uploading files, be they images or movies? Thank you for your time.

File Upload to database (and download)



How can I upload a file to a database (with as little code as possible!) along with a desciption of a file and then search through the descriptions to retrieve the appropriate files. Then how can I click on one and download it.

I am not a very advanced programmer and would like full step by step code if possible not just a link to a website.

Thank you very much


Powerhsell script for MOSS 2007 to get content database size



Can you please provide me a script to get content database size in MOSS 2007.




Multiple Images upload to SQL Database C# code help pls !



I have a web form where user can upload image and store to SQL database. (SQL tables has a relation like one title has multiple images fields).

Title: <asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox>

Image Name:<asp:TextBox ID="txtImage" runat="server" Width="200px"></asp:TextBox>

<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="btnSubmit" runat="server" Text="Submit Information" 
               onclick="btnSubmit_Click" />

aspx.cs code:

 protected void btnSubmit_Click(object sender, EventArgs e)
//to store image into sql database.
         string strImageName = txtImage.Text.ToString();      

                    if (FileUpload1.PostedFile != null &&
                    FileUpload1.PostedFile.FileName != "")
                           byte[] imageSize = new byte[FileUpload1.PostedFile.ContentLength];
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