I am trying to upload files to a folder and have been foloowing the examples online, but always get the following error. It uploads a funky fiel name to the tempfolder then trys to find the file and upload, what is strange is that if more than 1 file it finds all but the last one and then erros out. Dont get this one.
telerik:RadAsyncUpload ID="RadUpload" runat="server" Width="260px" AllowedFileExtensions="pdf, docx, doc, xfdl" MultipleFileSelection="Automatic"
TargetFolder="~/Uploads" TemporaryFolder="~/Uptemp"></
telerik:RadAsyncUpload
>
'Upload all the files to a permanent location
For Each file As UploadedFile In attachments.UploadedFiles
Dim TargetFolder As String = attachments.TargetFolder
file.SaveAs(TargetFolder & "Name " & file.GetName.ToString)
sql = "Insert PriorServiceUpload (intPriorServiceId, strUrl) VALUES (" & PriorId & ", '" & file.FileName & "')"
insertUpdateDelete(sql)
Next
Could not find file 'C:\inetpub\wwwroot\Recruiting\Uptemp\fpgummmw.syg'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not find file 'C:\inetpub\wwwroot\Recruiting\Uptemp\fpgummmw.syg'.
Source Error:
Line 54: For Each file As UploadedFile In attachments.UploadedFiles
Line 55: Dim TargetFolder As String = attachments.TargetFolder
Line 56: file.SaveAs(TargetFolder & "Name " & file.GetName.ToString)