Environment versions
Network:
Windows 2003 Server
Hi!
I have a problem using the input file, what I want to do is either send the file with an attachment or upload it on the server. When I do my test on my PC everything is OK but when I put it on the server everything fail. We open permission, we did a lot of things but it still doesn't do it. We don't have errors. Is anyone have a solution?
Thanks Joel :)
Here the code with the filesaveas;
Dim strFilename As String
Try
' Get the file name.
strFilename = filUpload.PostedFile.FileName
If filUpload.PostedFile.ContentLength = 0 Then
Else
' Get the base name for the file (exclude path).
strFilename = System.IO.Path.GetFileName(strFilename)
' Save uploaded file to server.
filUpload.PostedFile.SaveAs("\\www.ubishops.ca\uploadfiles\" & strFilename)
'I ALSO TRIED IT WITH THIS Server.MapPath("./uploadfiles") & "/"
End If
Catch ex As System.UnauthorizedAccessException
Me.TextBox1.Text = "You must set the permissions on the server to allow the ASPNET user to write to the destination folder."
Catch ex As Exception
Me.TextBox1.Text = "An unexpected error occurred: " & ex.Message
Finally
End Try
'MAIL ATTACHMENT CODE
Dim msg As New MailMessage
With msg
.From = Me.mmlblClient.Text + "@SERVER"
.To = "MAIL@MAIL"
.Subject = "HelpDesk Service Request"
If filUpload.PostedFile.ContentLength = 0 Then
Else
'dim atcItem As New MailAttachment(Request.MapPath("./uploadfiles") '& _
'"\" & strFilename)
Dim atcItem As New MailAttachment(strFilename)
.Attachments.Add(atcItem)
End If
.Body = "ITS PrintShop Request#"
'Me.txtDescription.Text
End With
'msg.Attachments.Add(llist)
SmtpMail.SmtpServer = "SERVER"
SmtpMail.Send(msg)
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only