Learn More





Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesupload download large fileupload download large file
New Post
4/12/2013 6:42 AM
hi experts
i want to store large file in to data base in binary format (up to 2 gb) and also download it
can please any body tell me how can i upload download the large file fromdata base .

i tried it works for small size of file like 5 , 10 mb but giving out of range exp for larger file
also i made needed changes in web config

please provide me code if possible
New Post
4/12/2013 9:28 PM

How are you planing on getting this file into the database - are you talking about writing a custom module ?

In which case - you would first need to look at an async file uploader of some sort.

DNN includes a runtime wrapper version of the telerik async control called:


Its functionally equivalent to:


which has extensive documentation here:


New Post
4/13/2013 4:26 AM
you may upload the file to the server using ftp or WebDAV, but importing it into sql server blob is not a good idea IMHO for performance reasons.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group   European Network of DotNetNuke Professionals

Speed up your DNN Websites with TurboDNN
New Post
4/15/2013 10:57 AM

Thanks wes and sebastian  for your reply

this is the req to store the file into the database in binary formate
i have wrote the code for uploading and dowloading also but this works for the small size of file not for bigger one

see code below

DataTable dtfile = new DataTable();
ViewState["DocType"] = e.File.GetExtension();

using (Stream f = new FileStream("C:/Documents and Settings/" + e.File.FileName.ToString(), FileMode.Open))
int offset = 0;
long len = f.Length;
byte[] buffer = new byte[len];  // here i got error while upload bigger file out of memory exp

int readLen = 100; // using chunks of 100 for default

while (offset != len)
if (offset + readLen > len)
readLen = (int)len - offset;
offset += f.Read(buffer, offset, readLen);

WriteToDB(e.File.FileName, e.File.ContentType, ref buffer);


while using above code the file is uploading into the db but i got exeption when byte[] buffer = new byte[len];
when upload the larger file the byte array goes out or memory exption

please let me know what can i use in place of byte array or any other solution please provide code if poosible wating for you reply
New Post
4/16/2013 3:10 AM
any reply on above
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesupload download large fileupload download large file

These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
Try Evoq
For Free
Start Free Trial
a Demo
See Evoq Live
Need More Information?