Re: Ajax Uploader Evaluation ~ Demo Problems

  •  03-28-2008, 9:27 AM

    Re: Ajax Uploader Evaluation ~ Demo Problems

    HI Adam,
     
    I am using VB.NET in VS2003 (v7.1.3088) with .NET Framework 1.1.4322(SP1).
     
    I made the following changes to the file called simple-upload.aspx as you suggestered:
     
    Private Sub Uploader_FileUploaded(ByVal sender As Object, ByVal args As UploaderEventArgs)
       Dim uploader As Uploader = DirectCast(sender, Uploader)
       InsertMsg("File uploaded! " & args.FileName & ", " & args.FileSize & " bytes.")
       'Copys the uploaded file to a new location.
       args.CopyTo("C:\Data\Dev\")
       'Opens the uploaded file's data stream.
       System.IO.Stream data = args.OpenStream()
    End Sub 
     
    I received the following error mesage:
     
    Compiler Error Message: BC30691: 'Stream' is a type in 'IO' and cannot be used as an expression.

    Source Error:
    Line 37:             args.CopyTo("C:\Data\Dev\")
                Line 38:             'Opens the uploaded file's data stream.
                Line 39:             System.IO.Stream data = args.OpenStream()
                Line 40: 		End Sub
                Line 41: 		</script>

    I made the following changes instead:
     
    Private Sub Uploader_FileUploaded(ByVal sender As Object, ByVal args As UploaderEventArgs)
       Dim uploader As Uploader = DirectCast(sender, Uploader)
       Dim data as System.IO.Stream
     
       InsertMsg("File uploaded! " & args.FileName & ", " & args.FileSize & " bytes.")
       'Copys the uploaded file to a new location.
       args.CopyTo("C:\Data\Dev\")
       'Opens the uploaded file's data stream.
       data = args.OpenStream()
    End Sub 

    I received the following error mesage:
     
     
    Exception Details: System.IO.IOException: The process cannot access the file "C:\Data\Dev\CuteSoft\UploaderTemp\uploading.a7a36c32-afe4-43bc-8b1b-0df7a6c1edc6.Test.txt.resx" because it is being used by another process.
     
    Do you have any other suggestions that I can try to resolve this issue.
     
    Regards,
    Arlan
     
     
View Complete Thread