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: Friday 26th of October 2012 06:44:22 AM Total Views:  766
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




replacing a specific line in a text file quickly

hey, i have a remove user and change password script written, but the only thing they are missing is the actual text file editing part. i have the file open because i have read it, but how can i delete a line that matches with 'OldLine' and put 'NewLine' where it was with a couple of lines of code
VIEWS ON THIS POST

413

Posted on:

Friday 26th October 2012
View Replies!

The database file or object is read only

hello all Actually, I do not know why i can not add records to my access database table by using asp code, I get an error that tells me that the database file or object is read only file even though the file is not readable only from its proprties, I need some helpful information to solve this problem.
VIEWS ON THIS POST

328

Posted on:

Friday 26th October 2012
View Replies!

scan txt file to computer

elo...im in trouble now....!!! may u help me to scan txt file to computer. i need to know how to scan txt file from specific device to computer..
VIEWS ON THIS POST

331

Posted on:

Friday 26th October 2012
View Replies!

read and write datas into excel(.csv) file

how can i read the datas in specific columns and rows from excel(.csv) file and then use that datas to calculate the min(example) and write the results into the same excel(.csv) file
VIEWS ON THIS POST

336

Posted on:

Friday 26th October 2012
View Replies!

Read & Parse Zip file using VB.NET

i need to open a zip archive, identify a particular file and read it.
VIEWS ON THIS POST

256

Posted on:

Friday 26th October 2012
View Replies!

Inserting binary files.

How can I insert a binary file into a SQL Server db using asp It must be possible cause SQL Server has a datatype called "varbinary". Thanx in advance Mojito
VIEWS ON THIS POST

229

Posted on:

Friday 26th October 2012
View Replies!

File Extension Validation before uploading the file....

Hi... I have an upload feature on my site... it works fine... but I want to validate the uploading file extension for .doc or .html before being uploaded to the server(client-side). I have the validation to check text fields are not blank.... The first validation is for checking the text field... the second "blob" is the file upload field.... This is my code in Vbscript.... can any one help please Code:
VIEWS ON THIS POST

642

Posted on:

Friday 26th October 2012
View Replies!

dynamic file path for uploads and downloads

, I am new to asp and databases to excuse my stupidity I have setup a site that allows users to login with a username and a password that are stored in a mysql database, now what i need to do is set it up so the users can only download specific file(s) related to their username. With my current set up using all asp and iis 5.0 all the users can download the same file from a certain directory. I was thinking of somehow using the session variable of the username as a variable in the download path of the file, but i don't know if this is a correct method of doing this or the correct syntax.
VIEWS ON THIS POST

329

Posted on:

Friday 26th October 2012
View Replies!

Populating two drop-down boxes from a DBF file

Hi all, We're trying to put our auto parts catalog on the Web. It's searchable if I have the user type in the Manufacturer and Model (for example: PONTIAC and FIREBIRD), but in order to prevent mistakes from typos, we'd rather have those choices be in drop-down boxes for the user to select from. I was able to have the first drop-down box created automatically from my dbf, but I'm unable to have the second drop-down box automatically populated after that. For example, if the user chooses PONTIAC from the first drop-down, I want all Pontiac models (FIREBIRD, GRAND AM, etc.) to comprise the second drop-down, automatically from my dbf. And once that's done, the .ASP page should take the Manufacturer and Model info to return the application listing. I've included my code below. I'm very new to ASP, but think I'm close. Maybe I'm not. If anyone could please take a look at this and let me know what I need to do to finish this up, you'll be my new best buddy.
VIEWS ON THIS POST

331

Posted on:

Friday 26th October 2012
View Replies!

Writing to a file on an MS hosted server

Please be gentle!! (I haven't been coding asp for long ) I am having problems (permission denied) trying to write a file to my website (hosted on an MS server). I wish to retrieve user details from a form, have this emailed (which I have achieved using aspmail) AND added to a file stored on the web. However, when I try to write using the FileSystemObject, I get the permission denied error. Would this be the correct way of doing this operation or am I missing something The files are in a directory named 'mail' Many
VIEWS ON THIS POST

267

Posted on:

Friday 26th October 2012
View Replies!

How can i update a text file through ASP

to all, I am ASAD, i want to know the process of updating a text file through asp how can i update my text file through ASP,pls assist me
VIEWS ON THIS POST

304

Posted on:

Friday 26th October 2012
View Replies!

Convert file xml to txt

Hi all, I need your help. I try this ASP code for convert file xml to txt. I don't have error but the output is txt file null (0 kB). Can you help me
VIEWS ON THIS POST

329

Posted on:

Friday 26th October 2012
View Replies!

"input type=file" sourcefolder

hi again! Very LAST part of the project: I want users to pick a file from a pool (=folder) in which they should be 'locked'. I tried using this method: Once clicked the browse button, it takes the user to a client folder. I want to take the user to the pool on the server which has the uploaded images. Is this possible If so: how
VIEWS ON THIS POST

165

Posted on:

Friday 26th October 2012
View Replies!

Attaching Excel file to a mail in asp

I have got an excel file.I want to attach it to my mail attachment which is send using asp.The excel file contains information abt all the employees in the organization.I want to send email to all the employees their details only.ie I want to select data from that excel file and attach it .The attachment shud contan\in only information relevant to the employee.Can I select data from an excel file and insert to an excel fiel in asp Pls help Thnx Nebu
VIEWS ON THIS POST

192

Posted on:

Friday 26th October 2012
View Replies!

Append message to a file.

I have a problem appending text to a designated file (user.txt), I can append the same text to another same file content in the same directory but different name (test.txt). I think the reason might be that user.txt is read by other page whereas test.txt is not. Is there other possible reason for my problem and is there a way to solve it I am not sure am I clear with my question....if not, I will post my code....
VIEWS ON THIS POST

234

Posted on:

Friday 26th October 2012
View Replies!

ASP files redirecting....

Hi.. We are trying to redirect our long dynamic asp url to simple asp files for better crawling and site management, the old path is http://www.abc.com/tour/asiaIS/ban/c...ry%5FInc%2Ehtm this file doest not exists physically, they have been called through a asp based program, these path is generated automatically by a script, can anyone tell me the way out to redirect this page to a new asp file like this - http://www.abc.com/tour/india/ban.asp can it be done through .htaccess file, Please help me out, any help is appreciated.......
VIEWS ON THIS POST

279

Posted on:

Friday 26th October 2012
View Replies!

Re-Directing a webpage output to a log file

it is possible to redirect content that would normally appear on a webpage into file instead. I have webpages that I want to be able to switch into LOG mode where the entire content is instead written to a file. It is an ASP Page with some 3rd party Javascript and simple HTML headers etc Any ideas Many
VIEWS ON THIS POST

306

Posted on:

Friday 26th October 2012
View Replies!

Save as prompt for an html file

I'm working on an ASP site that builds web pages for people and then stores the file on the server. I have that much working but I also want users to be able to save the html file to their hard drive with the click of a button. How would I go about doing this, an href just opens the page in a new window, it doesn't prompt for a save of the file which is what I want. Anyone know some javascript or ASP code I could use to do this
VIEWS ON THIS POST

234

Posted on:

Friday 26th October 2012
View Replies!

How to reference a DLL file stored in bin?

I have a third-party DLL which is to be used to create an object in classic Asp like so: Set obj=Server.CreateObject("XXXX.YYYY") The website where it will be used is commercially hosted and, if absolutely necessary, the Host techs are prepared to Register the DLL on the Windows 2008 Server. However they want me to try placing the DLL in the bin folder first, and see if it works from there. I'm happy to do it their way, but there's a missing piece in the puzzle. Other than dropping the DLL in the bin folder, their instructions are to: "Add the reference for the DLL in your project, then you will be able to use the DLL functions." Can someone tell me how to "Add the reference" TIA
VIEWS ON THIS POST

296

Posted on:

Friday 26th October 2012
View Replies!

zip files for download

Hi I have created a form where it consists of a checklist from which the user select which files they would like to download. When the form is submitted, i would like the files that have been checked to be zipped up and then made available for the user to download/save to their machine. Does anyone have any ideas how to execute this The server i am working on is IIS6 on Server 2003 R2. I have looked at this component but have add no joy with it, the page executes but nothing happens. Are there any other alternative components that anyone has had experience with link
VIEWS ON THIS POST

306

Posted on:

Friday 26th October 2012
View Replies!