I'm trying to get the AjaxFileUpload control working and it's giving me some strange problems. It looks like when I call SaveAs the file is just being deleted and not saved in the directory I specify.

Protected Sub AjaxFileUpload1_OnUploadComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AjaxFileUploadEventArgs) Handles AjaxFileUpload1.UploadComplete
Try
       Dim filePath As String = "C:\Inetpub\wwwroot\domain2\files\" & Convert.ToString(e.FileName)
       If e.FileSize > 72000 Then
           Return
       Else
           ajaxFileUpload.SaveAs(filePath)
       End If
Catch ex As Exception
      Throw ex
End Try
End Sub

The file uploads on to the server in to c:windows\temp_ajaxfileupload\somerandomstring\test.txt but disappears once ajaxFileUpload.SaveAs(filePath) is called and then i get a "Can not find the file c:windows\temp_ajaxfileupload\somerandomstring\test.txt" error. I'm uploading from one website and trying to save to another site on the same server with the same IUSR.

That should say

ajaxFileUpload1.SaveAs(filePath)

btw.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.