Forum Moderators: open

Message Too Old, No Replies

upload file

         

flashman

3:58 pm on Aug 26, 2003 (gmt 0)

10+ Year Member



i need simple uploading file script.

With best regards.

txbakers

4:16 pm on Aug 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a perl script that allows the user to upload a file and send it as an attachment via email.

Do a google search for this type of script.

I'm working on a project that will allow an upload, and ftp the file to a directory and update a database with information about the file being uploaded. It will be cool if I can get it to work.

garann

7:12 pm on Aug 26, 2003 (gmt 0)

10+ Year Member



Hi flashman,

What language are you looking for? I have some simple ASP.NET code or a VB.NET class that will do this. Not sure if I should post the code for the latter; it's pretty long. But robust! Here's the ASP:

Sub Page_Load(obj as Object, E as EventArgs)
Dim i As Integer
Dim bills as HttpFileCollection = Request.Files
dim pth as String = request.physicalApplicationPath
For i = 0 To (bills.count-1)
If bills.item(i).fileName <> "" Then
dim fileNm as String = parseName(bills.item(i).fileName)
bills.item(i).SaveAs(pth & "\documents\pdfInitial\" & fileNm)
end if
Next i
response.redirect("default.aspx?status=uploaded")
End sub

function parseName(flNm)
dim charArr as char() = {"\"}
dim subStrings as String() = flNm.split(charArr)
return subStrings(subStrings.length-1)
end function