<input type="file" multiple >
<asp:FileUpload ID="FileUpload1" multiple="multiple" runat="server" style="text-align: justify" Width="155px" />
上传控件
Sub savefile(_dest_dir As String)
Dim files As HttpFileCollection = Request.Files
Dim rnd As New Random
Dim f As HttpPostedFile
Dim fn As String = "", ex_name As String = ""
Dim dest_dir As String = System.IO.Path.Combine(Server.MapPath(UploadedFiles_Folder), _dest_dir)
If Not System.IO.Directory.Exists(dest_dir) Then
System.IO.Directory.CreateDirectory(dest_dir)
End If
For i As Integer = 0 To files.Count - 1
f = files(i)
ex_name = System.IO.Path.GetExtension(f.FileName)
‘这里是重点,文件名不能重复
fn = dest_dir & "\" & Format(DateTime.Now, "yyyyMMddHHmmss") & "00" & rnd.Next(1, 990).ToString & ex_name
f.SaveAs(fn)
Next
Response.Write("上传成功'")
End Sub
你大概看下吧,在IOS下c1也是只保存了最后一个文件,只要c1不用原始文件名保存就可以了。
|