UploadPersistedFile.TempDirectory property setting ignored

Last post 04-28-2010, 9:42 PM by cutechat. 4 replies.
Sort Posts: Previous Next
  •  04-28-2010, 6:26 AM 60497

    UploadPersistedFile.TempDirectory property setting ignored

    Hi,
     
    I'm using an UploadPersistedFile object in an user control where I set the following in Page_Load:
     
                Dim l_sTempDir As String = "~/sysfiles/TempAjaxUploader/"
                wsUploadFile.AutoUseSystemTempFolder = False
                wsUploadFile.TempDirectory = l_sTempDir

     
    When running the application I can select a file to upload and it seems to be uploaded, but then at the end a JavaScript alert message is displayed stating: "Unable to find the uploaded file in the directory: C:\Data\Web\Websites\WebwareNET\UploaderTemp"
    So the temporary directory settings above are totally ignored.
     
    What am I missing here? 

    Regards, Marja
  •  04-28-2010, 7:29 AM 60499 in reply to 60497

    Re: UploadPersistedFile.TempDirectory property setting ignored

    Problem solved by installing the latest DLL.
    Regards, Marja
  •  04-28-2010, 10:19 AM 60508 in reply to 60499

    Re: UploadPersistedFile.TempDirectory property setting ignored

    Correction: the problem is not solved yet. I'm getting this same JavaScript alert again.
    What's happening here? 

    Regards, Marja
  •  04-28-2010, 10:39 AM 60509 in reply to 60508

    Re: UploadPersistedFile.TempDirectory property setting ignored

    This turned out to be a postback issue:
    The temporary directory was set in Page_Load but only initially, and not after postbacks. I'm now always setting these properties in Page_Load  and that's working just fine now.

    Regards, Marja
  •  04-28-2010, 9:42 PM 60529 in reply to 60509

    Re: UploadPersistedFile.TempDirectory property setting ignored

    Marja,
     
    Yes, you need set this property every once the page init.
     
    Because this is a security property, uploader will not remember it via ViewState.
     
    Regards,
    Terry
View as RSS news feed in XML