Hello!
I have used freeASPUpload.a sp (from http://www.freeaspupload.net/ ) to upload files to my server. However, there where two problems:
So I made some changes. I would like to submit at least the Unicode part to the authors, but I cannot find out who they are. Does anybody know??
Any way, I'll just post the code here if someone else runs into the same problem. Changes to the original code:
So a typical call if you only have uploaded one file might be
I attach the asp-file as .txt
I have used freeASPUpload.a sp (from http://www.freeaspupload.net/ ) to upload files to my server. However, there where two problems:
- It doesn't support Unicode (I use UTF-8)
- Already existing files are overwritten
So I made some changes. I would like to submit at least the Unicode part to the authors, but I cannot find out who they are. Does anybody know??
Any way, I'll just post the code here if someone else runs into the same problem. Changes to the original code:
- I modified the function String2Byte to support requests made in UTF-8
- added an internal function GetFileName(str SaveToPath, FileName) that finds out if a file already exists and in that case finds a unique file name
- added a function "public sub SaveOne(path, num, byref outFileName, byref outLocalFileNam e)" that saves one file (for example number 0 would be the first file in the request) and returns the original filename and the local file name since it may be renamed if the file already exists in the path specified on the server
So a typical call if you only have uploaded one file might be
Code:
Dim Upload, fileName, localFileName, localDocumentPath localDocumentPath = Server.MapPath("/documents") Set Upload = New FreeASPUpload Upload.SaveOne localDocumentPath, 0, fileName, localFileName
Comment