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




Related Messages:

replacing a specific line in a text file quickly   (193 Views)
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
The database file or object is read only   (129 Views)
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.
scan txt file to computer   (171 Views)
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..
read and write datas into excel(.csv) file   (198 Views)
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
Read & Parse Zip file using VB.NET   (144 Views)
i need to open a zip archive, identify a particular file and read it.
Inserting binary files.   (144 Views)
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
File Extension Validation before uploading the file....   (361 Views)
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:
dynamic file path for uploads and downloads   (166 Views)
, 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.
Populating two drop-down boxes from a DBF file   (151 Views)
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.
Writing to a file on an MS hosted server   (131 Views)
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
How can i update a text file through ASP   (160 Views)
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
Convert file xml to txt   (181 Views)
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
"input type=file" sourcefolder   (89 Views)
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
Attaching Excel file to a mail in asp   (115 Views)
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
Append message to a file.   (133 Views)
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....
ASP files redirecting....   (145 Views)
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.......
Re-Directing a webpage output to a log file   (150 Views)
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
Save as prompt for an html file   (121 Views)
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
How to reference a DLL file stored in bin?   (158 Views)
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
zip files for download   (142 Views)
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