جزاك الله خير وأخيراً أرتحت من هالموضوع
نفذت المشروع مع بعض التعديلات
اقتباس:
| Protected Sub btnup_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnup.Click
lblerro.Text = Nothing
If upimg.PostedFile.FileName = Nothing Then
lblerro.Text = "Chose Your File"
Exit Sub
End If
Dim path As String = Server.MapPath("file") & "\" & IO.Path.GetFileName(upimg.PostedFile.FileName)
If upimg.PostedFile.InputStream.Length > 1000000 Then
lblerro.Text = "Your File is so Big"
Exit Sub
End If
If IO.Path.GetExtension(path) = ".PHP" Or IO.Path.GetExtension(path) = ".php" Then
lblerro.Text = "you file is no supported"
Exit Sub
End If
If IO.File.Exists(path) = True Then
Dim rname As String = System.Guid.NewGuid.ToString & IO.Path.GetFileName(upimg.PostedFile.FileName)
path = Server.MapPath("file") & "\" & rname
End If
upimg.PostedFile.SaveAs(path)
End Sub |