S
SHiGE
Guest
I know there is a few of this topic. But i couldn't find my answer.
I have the following code that work fine on my localhost.
But when i uploaded to jodohost, i couldn't upload it.
Do i need to set any permission on the folder that i'm going to upload to? or is the server disallow me trying to get the exisiting filelist for duplication checking?
Please help.
I have the following code that work fine on my localhost.
Code:
Dim FolderPath As String = ConfigurationSettings.AppSettings("PromotionUpload")
Dim MaxSize As Integer = ConfigurationSettings.AppSettings("PromotionImgSize")
'Checking filetypes
If Selected.PostedFile.ContentType = "image/pjpeg" Or Selected.PostedFile.ContentType = "image/jpeg" Then
Else
Return "The file you selected for upload is invalid! Only JPEG (*.jpg) files are allowed."
End If
'Checking for duplication
If Overwrite = False Then
Dim Directory As DirectoryInfo = New DirectoryInfo(MapPath(FolderPath))
Dim ExistingFiles() As FileInfo = Directory.GetFiles("*.jpg")
For Each myFile As FileInfo In ExistingFiles
If myFile.Name = Selected.PostedFile.FileName Then
Return "The file you selected for upload already exist in the server!"
End If
Next
End If
'Checking for size
If Selected.PostedFile.ContentLength / 1024 > MaxSize Then
Return "The file you selected for upload exceeded the allowable " & MaxSize & "KB file size!"
End If
'Uploading
Selected.PostedFile.SaveAs(Server.MapPath(FolderPath) & Selected.Value)
But when i uploaded to jodohost, i couldn't upload it.
Do i need to set any permission on the folder that i'm going to upload to? or is the server disallow me trying to get the exisiting filelist for duplication checking?
Please help.