FILEUPLOAD
Ciao a tutti
grazie alle varie informazioni reperite da voi in questo form
sono riuscito a fare un upload multiplo dei file.
codice upload
<script language="VB" runat="server">
Sub UploadMultipleFiles(obj As Object, e As EventArgs)
' if (FileUpload1.PostedFile.ContentLength > 1000000000) then
'response.Write("no")
' else
For Each postedFile As HttpPostedFile In FileUpload1.PostedFiles
Dim fileName As String = Path.GetFileName(postedFile.FileName)
postedFile.SaveAs(Server.MapPath("~/public/soluzione2correttainlavorazione/filecaricati/") & fileName)
response.Write(filename & "<br>")
Next
lblSuccess.Text = String.Format("{0} files have been uploaded successfully.", FileUpload1.PostedFiles.Count)
'end if
end sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:FileUpload ID="FileUpload1" runat="server" AllowMultiple="true" onchange="gestisciFile(this)" /><br>
<asp:Button ID="btnUpload" Text="Upload" runat="server" OnClick ="UploadMultipleFiles" />
<hr />
<asp:Label ID="lblSuccess" runat="server" ForeColor ="Green" />
codice webconfing
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" maxRequestLength="3145728" executionTimeout="999999" requestLengthDiskThreshold="2147483647" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="3221225472" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
la mia perplessita' è questa:
mi sono accorto che per fare un upload multiplo esempio 3 file (e tutti e 3 insieme pesano 500 mg)
prima il sistema carica tutto in memoria (ovvero tutti e 500 mg) e poi fa l'upload.
la domanda è:
si puo' fare in modo che il sistema carichi un file alla volta e faccia l'upload un file alla volta?
In questo modo forse si riuscirebbe a fare un upload anche piu' grande (nel senso che tutti i file insieme superano 1 gb)
grazie a tutti