ASP Upload Error


Everyone,

I have a problem with my ASP Upload Script.

I am getting the error says
Invalid Procedure Call Or Argument Code: Set MyFileObject = Server.CreateObject("Scripting.FileSystemObject") Set objFile = MyFileObject.CreateTextFile(filename,,-1) For i = 1 to LenB(value) objFile.Write chr(AscB(MidB(value,i,1))) 'Error On This Line Next objFile.Close Set objFile = Nothing Can anybody here aware of this

Any Help would be greatly appreciated.....

Posted On: Friday 26th of October 2012 07:35:30 AM Total Views:  382
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




uploading access database to webserver

I am new to ASP and I have been told to write a script that will automatically upload an access database stored in server in our building to the webserver located in another building. This script should run automatically once every week. Please help me out by suggesting how can i do it.
VIEWS ON THIS POST

563

Posted on:

Friday 26th October 2012
View Replies!

how to upload product image into database?

i would like to ask isit can upload image into database(ms access 2003) from asp. if can, how the code can be written then if after upload image into database. how we can retrieve it from database into asp page for viewing
VIEWS ON THIS POST

338

Posted on:

Friday 26th October 2012
View Replies!

File upload times out before the file is uploaded

I am using AspUpload to upload a pdf document of about 5mb to my site. After 90 seconds consistently, the upload finishes without an error. When I try to open the uploaded file, I get a 500 error. I can upload a smaller file successfully using the same code. Something appears to be timing out. In IIS, the session is set at 20 minutes and the VBScript at 600 seconds. The ADODB.Connection ConnectionTimeout and CommandTimeout are both set at 600 seconds. What am I doing wrong Your help would be much appreciated. Thanking you in anticipation. Roger
VIEWS ON THIS POST

222

Posted on:

Friday 26th October 2012
View Replies!

on uploading site database not supporting

hi, i have a problem with my site , when i am working it offline all operations (insert,update,delete) performing properly. but on uploading it on server it the query of insert update not working only select qry is working error is database or object is read only. on uploading database is connected properly code of registration page is- freg.asp registration main page (reg.asp page is on www.rajputvivahmanch.com) Code: na=request.form("name")'r etc.... 'inserting space in optional field if t="" then t=" " endif Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.open "reg",con,[color=#ff00f0]2,[color=#ff00f0]3 rs1.addnew rs1("photo")="no" rs1("paid")="no" rs1("title")= t rs1("name")= na rs1("age")= ag rs1("gender")=gn rs1("complexion")=com rs1("m_status")=mst rs1("feet")=f rs1("inch")=inc rs1("weight")=wt rs1("caste")=ca rs1("vansh")=vn rs1("gautra")=ga rs1("m_vansh")=m_vn rs1("m_gautra")=m_ga rs1("education")=ed rs1("fam_pro")=bk rs1("occupation")=j rs1("income")=i rs1("hobbies")=ho rs1("phy_status")=phy rs1("pro_desc")=des rs1("country")=cou rs1("state")=st rs1("city")=ct rs1("e_mail")=eml rs1("phone1")=p1 rs1("phone2")=p2 rs1("phone3")=p3 rs1("mobile")=mo rs1("address")=ad rs1("login_id")=id rs1("pass")=ps rs1.update rs1.open "reg",con,2,3 any one pl. help me
VIEWS ON THIS POST

598

Posted on:

Friday 26th October 2012
View Replies!

Manage upload error - Page 2

you have the code I posted if so, maybe there is no error - maybe the upload code simply terminates if the file is empty, without any error.
VIEWS ON THIS POST

273

Posted on:

Friday 26th October 2012
View Replies!

How to prevent overwriting, when upload files using pure ASP

I found this great article on ASP101.com about uploading stuff to a server from a internet client. The great thing is that it isn't an Object, but its PURE ASP and its FREE (whoo hoo). It works nice, and fast (although i only need it to allow my users to upload small Text files). But unfortunately if i upload a file that already exists it will be replaced (overwrite) with the new file and really, i don't want that to happened. (You never know) So my question is how do I prevent overwriting (I think that I need to make a new Sub function, but hell, that's just me) I could use an experts eye on this Code:
VIEWS ON THIS POST

321

Posted on:

Friday 26th October 2012
View Replies!

upload max size

I put together an upload utility based off of some code I found online. But, my problem is that I can't upload anything greater than 200KB in file size. How can I change that to something larger (e.g 1MB). I get is a 404 Error when I try to upload a large file. This is what my class looks like: Code: Class FileUploader Public Files Private mcolFormElem Private Sub Class_Initialize() Set Files = Server.CreateObject("Scripting.Dictionary") Set mcolFormElem = Server.CreateObject("Scripting.Dictionary") End Sub Private Sub Class_Terminate() If IsObject(Files) Then Files.Remove() Set Files = Nothing End If If IsObject(mcolFormElem) Then mcolFormElem.Remove() Set mcolFormElem = Nothing End If End Sub Public Property Get Form(sIndex) Form = "" If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex)) End Property Public Default Sub Upload() Dim biData, sInputName Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos Dim nPosFile, nPosBound biData = Request.BinaryRead(Request.TotalBytes) nPosBegin = 1 nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13))) If (nPosEnd-nPosBegin) 0 Then Files.Add LCase(sInputName), oUploadFile Else nPos = InstrB(nPos, biData, CByteString(Chr(13))) nPosBegin = nPos + 4 nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2 If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin)) End If nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds) Loop End Sub 'String to byte string conversion Private Function CByteString(sString) Dim nIndex For nIndex = 1 to Len(sString) CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1))) Next End Function 'Byte string to string conversion Private Function CWideString(bsString) Dim nIndex CWideString ="" For nIndex = 1 to LenB(bsString) CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1))) Next End Function End Class Class UploadedFile Public ContentType Public FileName Public FileData Public Property Get FileSize() FileSize = LenB(FileData) End Property Public Sub SaveToDisk(sPath) Dim oFS, oFile Dim nIndex If sPath = "" Or FileName = "" Then Exit Sub If Mid(sPath, Len(sPath)) "\" Then sPath = sPath & "\" Set oFS = Server.CreateObject("Scripting.FileSystemObject") If Not oFS.FolderExists(sPath) Then Exit Sub Set oFile = oFS.CreateTextFile(sPath & FileName, True) For nIndex = 1 to LenB(FileData) oFile.Write Chr(AscB(MidB(FileData,nIndex,1))) Next oFile.Close End Sub Public Sub SaveToDatabase(ByRef oField) If LenB(FileData) = 0 Then Exit Sub If IsObject(oField) Then oField.AppendChunk FileData End If End Sub End Class Sorry for the lengthy code ..... I know its a lot of code to post. If you try googl'ing on file uploading with asp, you' re bound to find the exact same code on several sites. However, none of them tell you how to limit the file size. I tried changing one of the lines as below, but I had no luck Code: If oUploadFile.FileSize > 0 And oUploadFile.FileSize < 100000000 Then Files.Add LCase(sInputName), oUploadFile
VIEWS ON THIS POST

244

Posted on:

Friday 26th October 2012
View Replies!

File upload component in ASP

Hi everybody, i use the ASP Simple upload component to upload files. do you know if there are differences between asp simple upload and asp smart upload concerning the size of the uploaded files i want to upload 5 Mo-sized files and I have problems using asp simple upload thanx for ur help constance
VIEWS ON THIS POST

164

Posted on:

Friday 26th October 2012
View Replies!

please help upload a picture into a database

.....
VIEWS ON THIS POST

224

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

496

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

208

Posted on:

Friday 26th October 2012
View Replies!

Problems with upload

Hi!I use the Adrian Forbes ASP upload class. But I have a problem when I use great files of 1 MB. The IIS responds that it cannot show the page to me.You know this problem It is necessary to modify something in iis or in aspTk a lot ofjose antonio
VIEWS ON THIS POST

113

Posted on:

Friday 26th October 2012
View Replies!

help - advanced upload form

, i've been working on a small website as a school project I need help with the following things: i made a managers login page, managers who logged in can upload images together with a description of the image. The uploaded image/desc should then appear on an HTML page on a table (table has 2 rows 1 for the img and 1 for the desc) when ever a new uploaded img/desc added, it should appear on the top of that table. The question is how to do that i've got no clue about uploading and stuff so any help is very appreciated.
VIEWS ON THIS POST

174

Posted on:

Friday 26th October 2012
View Replies!

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

625

Posted on:

Friday 26th October 2012
View Replies!

Free upload tools

Hi all, I was wondering if the free upload tools are recommended to use. Can anyone recommend a good trusted site that has upload tools.
VIEWS ON THIS POST

222

Posted on:

Friday 26th October 2012
View Replies!

problem in uploading file

i am new to asp help me please i am using msxml.xmlhttp.4.0 for uploading a file to the server when i upload the file the error message is displayed what might be the problem
VIEWS ON THIS POST

529

Posted on:

Friday 26th October 2012
View Replies!

Creating a form and uploading it to sharepoint

Hi. I am trying to create a computer management form/web application. I am not a good programmer. I use sharepoint at work to do most of the tasks which are fairly automated. Now the computer management form is designed this way: Name Type(DropDown) Used(Checkbos) AssignButton --------------- Switch _ ---------------- Computer name Server | _| BUTTON ---------------- Desktop ----------------- Router That is basically what the form will look like When user clicks the checkbox, it should pop up with a messagebox telling to user do you want to assign this computername. If the user click OK then it should DIMMM the Asign button and dimm the checkbox. So users know this computer name is assigned and cannot be used. Now the form should be able to remember these settings when the user checks this form the next time. So what should i use a database or a text file what language should i use as i have to upload it on sharepoint and it supports i think asp ... or page created in frontpage\t\t not good with programming languages so forgive me if i act a bit dumb any help will be appreciated
VIEWS ON THIS POST

474

Posted on:

Friday 26th October 2012
View Replies!

File upload functionality

I know this request is very ambiguous, but can anyone point me in the right direction (coding or 3rd party app) to developing asp code that will enable users to upload files from their web browser to their web sites Eventually I would like to have it set up so that non-technical users can post their own word docs or information to their webpage(s), for immediate viewing, without intervention from a tekkie.
VIEWS ON THIS POST

204

Posted on:

Friday 26th October 2012
View Replies!

Safari image upload problems

For some strange reason safari users cannot upload images / files to a site of ours. Other browsers on PC and Mac are fine, just not safari - any ideas
VIEWS ON THIS POST

214

Posted on:

Friday 26th October 2012
View Replies!

Asp multiple image upload

Hi i am coding in asp. I got a problem with uploading two image files to the server and database in a page. I got an image file uploaded in to server and the path got stored in db(MS Access). But when using two image files at a time using an upload component ,its not getting. I am using two images(small & enlarged) for a news from the admin system and uploading the images in a small and enlarge folders in the server. Hope u all got my problem.. Please reply soon.
VIEWS ON THIS POST

196

Posted on:

Friday 26th October 2012
View Replies!