Unable to Find Uploaded file in directory (sometimes)

Last post 10-07-2013, 10:13 AM by MelvanWyk. 17 replies.
Sort Posts: Previous Next
  •  08-20-2009, 3:24 PM 54861

    Unable to Find Uploaded file in directory (sometimes)

    I've got some users complaining of this message when trying to upload files.  They're using the latest build of Firefox and say that the popup appears after the file progress finishes.
     
    I can't reproduce the problem using the same site and same browser (or even IE7).  This has been working without issue for about 45 days now.   We're using a temp directory within the application and the files in there are all from today prefixed with "persisted" except for a couple that are prefixed with "uploading" in the name.
     
    The site is load balanced and when I'm comparing the files in the temp dir, I'm noticing that the same files are on both servers.  Also, the ones that say uploading are from hours ago.
     
    The site is running on Windows 2008, IIS7 (Integrated) using ASP.NET 3.5 sp1 and running under SSL.
     

    Thanks,
    David
  •  08-20-2009, 8:13 PM 54864 in reply to 54861

    Re: Unable to Find Uploaded file in directory (sometimes)

    Update.
     
    I'm now able to reproduce the problem.
     
    If I use FF (3.5.2) and disable Silverlight (3.0.40723.0) and enable Shockwave Flash (10.0.22.87) I will get the error message (Unable to Find Uploaded file in directory C:\..."  It works okay with Silverlight and no Flash and it also works when both are enabled.
     
    I just read a post that lists the order that the component will try to use Silverlight, Flash, etc.  Everything seems like it's in the "rich" mode (selecting the file dialog, the file extension filters are in place) but when I click Open to start the upload, it will display the progress bar and run up to 100% and then show the popup error.
     
    Flash should be enough right?  Is there something additional I need to do?
     
    1. <CuteWebUI:Uploader runat="server" ID="fileUploadA" InsertText="Upload File" InsertButtonID="imgUploadA" MultipleFilesUpload="true" MaxFilesLimit="3" TempDirectory="~/secure/questionnaire/uploaderTemp" OnFileUploaded="fileUploadA_Upload">  
    2.     <ValidateOption AllowedFileExtensions="jpg,jpeg,gif,tiff,doc,docx,xls,xlsx,pdf,zip,txt" />  
    3.     <ValidateOption MaxSizeKB="102400" />  
    4. </CuteWebUI:Uploader> 
     
    1. protected void fileUploadA_Upload(object sender, UploaderEventArgs args)  
    2. {  
    3.     byte[] fileBytes;  
    4.   
    5.     using (System.IO.Stream uploadedStream = args.OpenStream())  
    6.     {  
    7.         fileBytes = new byte[uploadedStream.Length];  
    8.         uploadedStream.Read(fileBytes, 0, (int)uploadedStream.Length);  
    9.     }  
    10.     DocHelper uploadDoc = new DocHelper();  
    11.   
    12.     if (uploadDoc.DocUploadAndSave(fileBytes, args.FileName, _questIdA))  
    13.     {  
    14.         BindDocumentGrid(gvDocsA, _questIdA);  
    15.   
    16.         //  Insert client script block (YFT).  
    17.         SetupYellowFade(gvDocsA);  
    18.     }  
    19.     else  
    20.         Master.DisplayMsg(false"Unable to store document.");  

     
     
     
  •  08-21-2009, 12:49 AM 54876 in reply to 54864

    Re: Unable to Find Uploaded file in directory (sometimes)

  •  08-21-2009, 12:49 AM 54877 in reply to 54861

    Re: Unable to Find Uploaded file in directory (sometimes)

    David,
     
    You need make a shared server folder add such setting to web.config :
     
    sample :
     
    <add key="CuteWebUI.AjaxUploader.TempDirectory" value="\\192.168.1.11\sharetemp" />
     
    and take care the read/write permissions.
     
    Regards,
    Terry
     
     
  •  08-21-2009, 3:37 PM 54909 in reply to 54877

    Re: Unable to Find Uploaded file in directory (sometimes)

    Okay, so if I use a common temp location between the two, it should fix the problem?
     
    I'm wondering if you could provide some info on user permission setup.  Once I begin referring to a network folder, I'll need the component or application to run under a different user account for read/write access correct?  Rather than have the entire app running under this user account, is there a way that I can have the component (or module I suppose) run under this network account?
     
    Thanks,
    David
  •  08-24-2009, 9:30 PM 54989 in reply to 54909

    Re: Unable to Find Uploaded file in directory (sometimes)

    David,
     
    We are investigating on the 'account' and will get back to you ASAP.
     
    To run as a special account, your website must have FULL trust level , so the code can even run the Win32 kernal API
     
    Regards,
    Terry
  •  08-24-2009, 10:52 PM 54998 in reply to 54909

    Re: Unable to Find Uploaded file in directory (sometimes)

    David,
     
    Please download the control again,
     
     
    Add this to web.config  <configuration> <appSettings>
     
      <add key="CuteWebUI.AjaxUploader.WindowsUsername" value="Terry" />
      <add key="CuteWebUI.AjaxUploader.WindowsPassword" value="12345abcde" />
      <add key="CuteWebUI.AjaxUploader.WindowsDomain" value="" />
     
    Your application need <trust level="Full" /> for this option
     
    Regards,
    Terry
  •  08-25-2009, 5:54 PM 55041 in reply to 54998

    Re: Unable to Find Uploaded file in directory (sometimes)

    I've configured a network share to host the temp files and setup the project with your above recommendations.  Everything is working as expected except when Silverlight is disabled and Flash is enabled in both IE7 and FF (which is the original problem).  Under these conditions, when I click the button that launches the open dialog, nothing happens.
     
    If Silverlight is enabled and Flash is disabled, it's fine.  If both are disabled, it falls back on the standard HTML input type="file" like control and it's fine.  The problem is isolated to when Flash is present but Silverlight is not.
     
    Could you please have another look?
     
    Thanks,
    David
     
    PS - I just realized that I downloaded version 3.0 20090412.  It supports the WindowsUsername, WindowsPassword and WindowsDomain appSettings properties but it seems like an older version.
     
     
  •  08-27-2009, 11:19 AM 55116 in reply to 55041

    Re: Unable to Find Uploaded file in directory (sometimes)

    I've figured out what's causing the file open dialog not to open.  I have the following code in all my upload pages to hide the cancel button.
     
    1. function CuteWebUI_AjaxUploader_OnStart() {  
    2.     var hidden = this;  
    3.     hidden.internalobject.insertBtn.style.display = "none";  
    4.     hidden.internalobject.cancelBtn.style.visibility = "hidden";  

    When using the above code to hide the cancel button and Flash is enabled and Silverlight is disabled, the open dialog will not appear.  I've confirmed this in both IE7 and FF 3.5.2.
     
    Is there a different approach I should take to hide the cancel button or is this a bug?  Please advise.
     
    Thanks,
    David
     
     
  •  08-28-2009, 9:02 AM 55146 in reply to 55116

    Re: Unable to Find Uploaded file in directory (sometimes)

    David,
     
    I don't understand your problem.
     
    Because the OnStart is fired after the file selected.
     
    Regards,
    Terry
     
  •  08-28-2009, 12:56 PM 55154 in reply to 55146

    Re: Unable to Find Uploaded file in directory (sometimes)

    You're right, my mistake.  I'm getting confused with all the tests I've been running.
     
    I have found the cause behind my problem.  To recap, the open dialog does not appear with Flash enabled and Silverlight disabled.  I've found that if I remove the ValidateOption tag (see markup in my first post) that specifies the file types allowed (AllowedFileExtensions), the dialog will appear.  I'm searching for another way to specify this (either in code or declarative markup).
     
    This must be unintended behavior, please investigate.
     
    Thanks,
    David
  •  08-28-2009, 1:25 PM 55155 in reply to 55154

    Re: Unable to Find Uploaded file in directory (sometimes)

    It behaves the same way even if it's defined in code.
     
    1. protected override void OnInit(EventArgs e)  
    2. {  
    3.     base.OnInit(e);  
    4.     fileUpload.ValidateOption.AllowedFileExtensions = "jpg,jpeg,gif,tiff,doc,docx,xls,xlsx,pdf,zip,txt";  

     
  •  08-28-2009, 8:58 PM 55160 in reply to 55155

    Re: Unable to Find Uploaded file in directory (sometimes)

    Hi,
     
    Please download the last version and try again.
     
    One of the recent version have bug on the AllowedFileExtensions (about 5-6 days ago).
     
    Regards,
    Terry
     
  •  09-02-2009, 5:52 PM 55322 in reply to 55160

    Re: Unable to Find Uploaded file in directory (sometimes)

    Perfect, all is good.
     
    Thanks for the super fast code updates.  
  •  12-08-2009, 10:22 AM 57666 in reply to 54864

    Re: Unable to Find Uploaded file in directory (sometimes)


    ignore this post....
     
  •  12-16-2009, 7:42 AM 57783 in reply to 55322

    Re: Unable to Find Uploaded file in directory (sometimes)

    Hi, i have the same problem. But the diference is that i'not using tha attribute AllowFilesExte.....
    The upload have been complete.... but the file was not rename to persisted.. so the aplication doesnt find it.
    i attached an image that show in the FTP the file that i was uploading...what can i do?
  •  12-16-2009, 10:25 PM 57806 in reply to 57783

    Re: Unable to Find Uploaded file in directory (sometimes)

    Hi,
     
    That is a temp file while the uploader parsing the uploaded data.
     
    You can use
     
    <add key="CuteWebUI.AjaxUploader.UseAspNetStream" value="True" />
     
    to disable that future.
     
    If you disable it,
     
    for asp.net1.1 , the asp.net will use memory to save the http data , the server will have no enough memory.
     
    for asp.net2.0 or later, the asp.net will save the http data to disk, but uploader will copy it to temp file again, that will spend much time to copy a big file.
     
    Regards,
    Terry
     
     
     
  •  10-07-2013, 10:13 AM 78065 in reply to 54861

    Re: Unable to Find Uploaded file in directory (sometimes)

    If you are using IIS to run you application. Then your problem lies with the <requestFiltering> section.

     

    This errors occurs, because IIS default only allows 30MB uploads due to security reasons.

     

    <system.webServer>     

    <security>         

    <requestFiltering>             

    <requestLimits maxUrl="10999" maxQueryString="9999" maxAllowedContentLength="2147483648" />       

    </requestFiltering>     

    </security> 

    </system.webServer> 

View as RSS news feed in XML