file in tempdir ok, uploaddir missing or corrupted

Last post 03-19-2011, 12:53 PM by jiminlodi. 2 replies.
Sort Posts: Previous Next
  •  03-17-2011, 5:12 PM 66726

    file in tempdir ok, uploaddir missing or corrupted

    Hi, I'm evaluating your product to find a replacement for the Microsoft FileUpload control. The Microsoft control works ok on the PC but not on the MAC. My code is below:
     
    webconfig 
     <appSettings>
        <add key="CuteWebUI.AjaxUploader.TempDirectory" value="~/Users/UploaderTemp"/>
        <add key="CuteWebUI.AjaxUploader.FileUploadLocation" value="~/Users/DMfiles"/>
      </appSettings>
     
     Protected Sub Uploader1_FileUploaded(ByVal sender As Object, ByVal args As CuteWebUI.UploaderEventArgs) Handles Uploader1.FileUploaded
            Session("DMfilename") = args.FileName
            Session("DMdest") = clsCX.GetRootPath & "\Users/DMFiles\" & Session("DMfilename")
            args.CopyTo(Session("DMdest"))
            args.Delete()
        End Sub
     
     <CuteWebUI:Uploader id="Uploader1" runat="server" ManualStartUpload="false" UploadType="Auto"
                            FileTypeNotSupportMsg="This file type not supported.">
                        </CuteWebUI:Uploader>
     
    This code (ignoring the args.delete...) always works to copy small xls files to the tempdir. If I don't use the args.copyto it doesn't write to the destination dir at all. With the args.copyto it sometimes works on the PC with Chrome but not at all on the MAC running Safari. Since this is new to me perhaps I have made a mess of the code and you can help me out.     TIA, jim
     
     
     
  •  03-17-2011, 10:34 PM 66730 in reply to 66726

    Re: file in tempdir ok, uploaddir missing or corrupted

    Hi Jim,
     
    I tested your code with Sarari, it does not work
     
    Please ref the code below and test again
     
    1. Private Sub Uploader1_FileUploaded(ByVal sender As Object, ByVal args As UploaderEventArgs)  
    2.         Session("DMfilename") = args.FileName  
    3.         Session("DMdest") = AppDomain.CurrentDomain.BaseDirectory & "Users\DMFiles\" & Session("DMfilename")  
    4.         args.CopyTo(Session("DMdest"))  
    5.         args.Delete()  
    6.     End Sub  
     This method removes Handles Uploader1.FileUploaded and corrects the CopyTo Path Session("DMdest")
     
    Regards,
    Jeff 
  •  03-19-2011, 12:53 PM 66757 in reply to 66730

    Re: file in tempdir ok, uploaddir missing or corrupted

    Thanks Jeff for your suggestions. I found several errors in the code including the path one you indicated. The control is working now and I like the simple one button interface. Excel files uploaded from any browser from a PC open on the remote site from Excel or the Farpoint Spread5 control we are using. But Excel files uploaded from a MAC open in Excel but not the Spread5 control so now I have to work on that side.
     
    Thanks again, Jim 
View as RSS news feed in XML