|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm in like a smal confusion over uploading images:
If Not (Upload.PostedFile Is Nothing) Then 'Check to make sure we actually have a file to upload Dim strLongFilePath As String = Upload.PostedFile.FileName Dim intFileNameLength As Integer = InStr(1, StrReverse(strLongFilePath), "\") Dim strFileName As String = "D:\(FYP)\Images\Banner" 'Mid(strLongFilePath, (Len(strLongFilePath) - intFileNameLength) + 2) Select Case Upload.PostedFile.ContentType Case "image/pjpeg", "image/jpeg" 'Make sure we are getting a valid JPG image Upload.PostedFile.SaveAs(strFileName) lblStatus.Text = strFileName & " was uploaded successfully to: " & strFileName Case Else 'Not a valid jpeg im age lblStatus.Text = "Not a valid jpeg image" End Select end if end sub But the error i encounter was access denied to the filename i declared. So is it possible cause due to the web service.. |
|
#2
|
|||
|
|||
|
Ignore tis line :
'Mid(strLongFilePath, (Len(strLongFilePath) - intFileNameLength) + 2) |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Upload Image |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|