SEARCH YOUR SOLUTION HERE  

Asp file uploading with adodb.stream

Hi all,

I have been working away all day at a method to upload files to a server. The files will typically be in the range 100-200MB.

The method which I have found is good is using ADODB.stream, and splitting the incoming data into chunks, with the incoming data coming from a "multipart/formdata" form.

Code: totalsize) then chunksize = totalsize end if bytesleft = totalsize set objADO = server.createobject("adodb.stream") objADO.type = 1 objADO.open counter = 0 do while bytesleft > 0 if (bytesleft < chunksize) then chunksize = bytesleft end if objADO.Write Request.BinaryRead(ChunkSize) objADO.Position = objADO.Size objADO.savetofile "C:\Inetpub\wwwroot\test2\content\response" & counter & ".txt" bytesleft = bytesleft - chunksize counter = counter + 1 loop objADO.close set objFSO = nothing %>
Now this works. It splits the incoming data into 128KB chunks, and writes each chunk to a separate file. This keeps down memory usage on the server. Every free upload script I have tried seems to keep the whole file in memory, and the box crashes!

But I need, obviously, to be able to save all the data in one file.

And ADODB.stream does not support an append feature.

Is there anyone out there that can help me

Cheers for any replies,
Bob.

p.s. components such as ASPupload aren't an option -- tight budget.

Posted On: Saturday 20th of October 2012 12:56:51 AM Total Views:  568
View Complete with Replies




Related Messages:

space with file name is giving problem   (215 Views)
Hi , I am new to ASP and VB Script. I am trying to open Exel file and Csv file from the website, my code is as follows. Response.Buffer = TRUE Response.Clear 'Response.AddHeader "Content-Disposition","inline;filename=" & sFile Response.AddHeader "Content-Disposition","inline;filename=" & sFile If Not GetReportOutputType.EOF And Not GetReportOutputType.BOF Then Response.ContentType = GetReportOutputType.Fields.Item("MimeType").Value End If Response.BinaryWrite( Data ) Response.End Set FileReader = Nothing else Response.Redirect("ReportViewErrorMsg.aspMode=FileNotFound") End If filetxt.Close if sFile name contains white space (test file.xls), the file openining with some error. Error contains some session variable. please help me out.
Upload a file to the server?   (224 Views)
I have just this morning built a very basic login area for myself. Now I wish to have a script that will move a file on to the server. I have tried looking up Google but it seems a bit quiet on tutorials with this. Can anyone point me in the right direction I basically want to be able to upload a file onto the server with an ASP script. Thank you, Michael.
Access files on a diffrent server/domain   (359 Views)
Hi allOk I would like to access files that arelocated on a diffrent server/domain.The idea is that people can access there work from home which is located in there user shares any help would be greatCheers
file download   (318 Views)
This is probably pretty basic, but I have little experience with client-side scripting. I am trying output a csv file to the client without going back to the server. The scenario is something like:1. User requests data.2. Data is displayed.3. User wants to download data.4. Download data to the user using entirely client-side scripting.I have it working by making a trip back to the server and streaming the content back as excel or csv.
Write to textfile with FSO ??   (181 Views)
How to write to a text file using FSO Here "
Retrieving ASP session value in an included .js file   (289 Views)
In an website editing page I have an included .js file which writes a rich text editor to the screen. (This doesn't work as an asp include btw)I need to get a variable containing the page content to the Javascript file so it can display it as part of its output but am unsure of how. I have already set an asp session with the content - can I transfer this to a javascript cookie or somethingI have used the method of including the .js file.Please help.
Concern about putting connection strings in an Include file (.inc)   (251 Views)
recently in an effort to start cleaning up my scripting (I'm pretty sloppy) and to reduce redundancy, I began putting database connection strings in an include file for all of my ASP.I've been doing this for a while now, but then it occurred to me the other day that anyone could view the source code of my page, add the .inc file onto the end of the web address in their browser and then view the connection string right there in their browser!Does anyone else do this What are the potential problems Is it a problem Any input would be great
want users to be able to download a file - don't know how to do it!   (284 Views)
I want users to be able to download a .pqa file from my website so that when they click on a link they get the option to either open the file or save it to disk.The only problem is I have no idea how to do it, so if someone could offer some advice I would really appreciate it
ASP Souce Code to read from an DB and write an XML file   (265 Views)
Hi all,I am needing to learn how to read an MS Access DBand output it to a XML file.But I would like to have an output with a default typejust like what I get when I use the export to XML insideAccess, should output for a table be something of this kind(example table calle Element with 3 columns):http://www.w3.org/2000/10/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="Element.xsd"> 11111-004BOSCH PUMP BOSCH 7363-CH ACTUATOR linearI have already some code but the output(described below after the code) is of nouse because of the format... I think itcontains also schema... Well if someone has the source the would yield an output like above or know how to do it I wouldbe more than grateful it you could send it to me in a reply or post here, I will grant it as a VERYexpertise help
#INCLUDE file problem   (249 Views)
I have some ASP's that use an Access database to store form info. The db connection info is in a separate file that I just #INCLUDE. Lateley I've seen error messages like 'File already in use' when an asp needs to read from the database. If the user refreshes the page, all works fine. Is this because only one person can access the #INCLUDE at a time Is there a way around this If this is not the cause, what could it be
How do I protect my asp files?   (323 Views)
I have a login page(page A) in which after successfully logging in, the user is directed to another page(page B). How can I protect this page(page B) from users directly typing in the URL, by passing the login page(page A)
Using asp to write a variable to a text file, from flash   (216 Views)
Hi does anyone know how to use asp to write a variable to a text file, and then read that variable back again Cheers if you can help me.... M@
Uploading images through form input type="file" help!!   (247 Views)
Hi1.How do you upload images to Access db 2. How do you find out if you server support images uploading through browser form3.How ASP works with that
Import text file from client to list   (233 Views)
Hi Folks,I am looking for some help importing values from a text file on a client machine into a list within an asp page. For example.....I have some functionallity that allows the user to add values one at a time to a list.....(via javascript) my problem is that the user may have as many as 500 - 2000 items to type in. I would like the user to import the values from the file or cut and paste the values from the file into the list array.See current code that allows individual add's to the list.any replies are greatly appreciated!regards,ejg---------------------------------------function move(fbox,tbox) {var i = 0;if(fbox.value != "") {var no = new Option();no.value = fbox.value;no.text = fbox.value;no.selected = truetbox.options[tbox.options.length] = no;fbox.value = ""; }}function remove(box) {for(var i=0; iThe Value Specified is
Dreamweaver forms,asp files, access databases   (247 Views)
This is my first go at writing scripts.i want to capture data entered on a form and write it to an access database. I know this subject has been covered previously but i'm still a little confused so any help would be very much appreciated. OK, heres the situation.I have created a form in dreamweaver - 2 textboxes (Name and IDand 5x5 groups of radiobuttons. At the moment i'm just seeing if what i enter in the textboxes will be written to an access db table named "table".In the form header i have the following: form layout (at the end)The script in my submissions.asp file looks like this:
ADO recordset into memory but want direct to file...?   (238 Views)
Is there a way using ADO to execute a SQL statement that instead of returning the recordset into a memory object that I can return it writing directly to a file objectCurrently, I am getting the record set and then writing it to file but during some testing I realized that when the record set is really large it consumes all of the machines memory and it's virtual memory as well before getting the chance to write to file (it is only 256megs for each but still).I am using ASP pages to call functions in a DLL developed in VB.ThanxJB
ADO recordset into memory but want direct to file...?   (271 Views)
Is there a way using ADO to execute a SQL statement that instead of returning the recordset into a memory object that I can return it writing directly to a file objectCurrently, I am getting the record set and then writing it to file but during some testing I realized that when the record set is really large it consumes all of the machines memory and it's virtual memory as well before getting the chance to write to file (it is only 256megs for each but still).I am using ASP pages to call functions in a DLL developed in VB.ThanxJB
How do i read out the file-description of an MS - OFFICE File ?   (319 Views)
Threaders,i need to read out the File-Description of Office-Documents. You surely now the Fields where you canset a Description, the author, etc... for an Microsoft Winword, Excel or any other Office-Document. Now i have to read this out in ASP ! I don t know how, so i hope any of you knows how to do this ...Thanx
error with file "the file does not exist or the path does not exist"   (267 Views)
I have created an ASP website, in which i want to open/download a .pdf file. When we click on the "download" button,the acrobeat reader will start, but it'll show theerror. "The file does not exist. or the path does not exist"Plz, check this on the website "Devanshi.com" in it "libarary" and then open any manual. It will show files of that manual.
How to write code to download pdf file from database   (299 Views)
How to write code to download pdf file from database.In main folder there is a subfolder in which many files arethere. we want to access this file through the databasein our website.