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:  416
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




space with file name is giving problem

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.
VIEWS ON THIS POST

136

Posted on:

Saturday 20th October 2012
View Replies!

Upload a file to the server?

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.
VIEWS ON THIS POST

136

Posted on:

Saturday 20th October 2012
View Replies!

Access files on a diffrent server/domain

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
VIEWS ON THIS POST

223

Posted on:

Sunday 21st October 2012
View Replies!

file download

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.
VIEWS ON THIS POST

186

Posted on:

Sunday 21st October 2012
View Replies!

Write to textfile with FSO ??

How to write to a text file using FSO \tHere "
VIEWS ON THIS POST

120

Posted on:

Monday 22nd October 2012
View Replies!

Retrieving ASP session value in an included .js file

In an website editing page I have an included .js file which writes a rich text editor to the screen.\t(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.
VIEWS ON THIS POST

179

Posted on:

Monday 22nd October 2012
View Replies!

Concern about putting connection strings in an Include file (.inc)

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
VIEWS ON THIS POST

147

Posted on:

Monday 22nd October 2012
View Replies!

want users to be able to download a file - don't know how to do it!

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
VIEWS ON THIS POST

175

Posted on:

Monday 22nd October 2012
View Replies!

ASP Souce Code to read from an DB and write an XML file

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";\txsi:noNamespaceSchemaLocation="Element.xsd">\t11111-004BOSCH\tPUMP\tBOSCH\t7363-CH\tACTUATOR\tlinearI 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
VIEWS ON THIS POST

161

Posted on:

Monday 22nd October 2012
View Replies!

#INCLUDE file problem

I have some ASP's that use an Access database to store form info.\tThe db connection info is in a separate file that I just #INCLUDE.\tLateley I've seen error messages like 'File already in use' when an asp needs to read from the database.\tIf the user refreshes the page, all works fine.\tIs this because only one person can access the #INCLUDE at a time\tIs there a way around this\tIf this is not the cause, what could it be
VIEWS ON THIS POST

173

Posted on:

Monday 22nd October 2012
View Replies!

How do I protect my asp files?

I have a login page(page A) in which after successfully logging in, the user is directed to another page(page B).\tHow can I protect this page(page B) from users directly typing in the URL, by passing the login page(page A)
VIEWS ON THIS POST

171

Posted on:

Monday 22nd October 2012
View Replies!

Using asp to write a variable to a text file, from flash

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@
VIEWS ON THIS POST

142

Posted on:

Monday 22nd October 2012
View Replies!

Uploading images through form input type="file" help!!

Hi1.How do you upload images to Access db\t 2. How do you find out if you server support images uploading through browser form3.How ASP works with that
VIEWS ON THIS POST

165

Posted on:

Monday 22nd October 2012
View Replies!

Import text file from client to list

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 = "";\t}}function remove(box) {for(var i=0; iThe Value Specified is\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
VIEWS ON THIS POST

140

Posted on:

Monday 22nd October 2012
View Replies!

Dreamweaver forms,asp files, access databases

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:
VIEWS ON THIS POST

148

Posted on:

Monday 22nd October 2012
View Replies!

ADO recordset into memory but want direct to file...?

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
VIEWS ON THIS POST

143

Posted on:

Monday 22nd October 2012
View Replies!

ADO recordset into memory but want direct to file...?

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
VIEWS ON THIS POST

187

Posted on:

Monday 22nd October 2012
View Replies!

How do i read out the file-description of an MS - OFFICE File ?

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
VIEWS ON THIS POST

183

Posted on:

Monday 22nd October 2012
View Replies!

error with file "the file does not exist or the path does not exist"

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.
VIEWS ON THIS POST

155

Posted on:

Tuesday 23rd October 2012
View Replies!

How to write code to download pdf file from database

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.
VIEWS ON THIS POST

164

Posted on:

Tuesday 23rd October 2012
View Replies!