Forum Moderators: open
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.
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