Allowed File Extensions work on AsynchUpload, but not Upload control?

Thread is closed for posting
13 posts, 0 answers
  1. Steve
    Steve avatar
    18 posts
    Member since:
    Feb 2011

    Posted 19 May 2011 Link to this post

    Hi,

    I was wondering why the list of allowed files (your sample shows jpeg, png, gif) are displayed properly in the 'File Type' dropdown when browsing for a file on the AsynchUpload control, but show 'All Files' on the upload control, even thought the settings are the same.  Also, is there a way to actually filter these types in the available files window, like Windoes Explorer?

    Thanks
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 20 May 2011 Link to this post

    Hello Steve,

    The AsyncUpload control using a Silverlight or Flash plug-in depending on your version of the controls, thus the reason it shows the allowed file types in the file type drop-down. But the standard RadUpload control cannot do that, since you can't control the browser's file dialog window.

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Steve
    Steve avatar
    18 posts
    Member since:
    Feb 2011

    Posted 20 May 2011 Link to this post

    Yes- I used AsynchUpload for that reason.  Works fine.  Thanks
  5. Steve
    Steve avatar
    18 posts
    Member since:
    Feb 2011

    Posted 20 May 2011 Link to this post

    Hello,  I had the AsynchUpload working fine;  then I got an update of the AJAXRad controls extensions, and now it is throwing errors in the jscript when I try to upload a file.  What is the resolution for this?

    Thanks
  6. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 24 May 2011 Link to this post

    Hello Steve,

    I have tested our demos with the latest version of our controls and everything is working fine - no javascript errors are shown.
    Which version of our controls are you using ?
    Please give us more information about the errors' descriptions and your scenario, or please open a support ticket and send us your project to examine it locally.

    All the best,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  7. Steve
    Steve avatar
    18 posts
    Member since:
    Feb 2011

    Posted 25 May 2011 Link to this post

    Hello,  I believe what's causing the error is when the user tries to upload a file that is open.  Javascript error is thrown.  I have been testing this on my local machine, so it may act differently on our web server (i.e. issue an 'error has occurred on the page', as opposed to crashing the app).  Is there any way to provide a warning that the file they are trying to attach is open by the user or another person? 

    Also, I want to disable the Upload ('Submit') button until a file is selected, and possible render an AJAX error warning that tells the user that a file must be selected.  Are there some examples of this?

    Thanks
  8. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 27 May 2011 Link to this post

    Hi Steve,

    I have tested to upload an opened .txt file on my local machine and in our demos. Everything works fine.
    The test was made with the latest version of our controls.
    We have been contacted about similar issue before, which is already fixed. What is the exact version of the Telerik.Web.UI.dll that you use?
    Could you please try our the latest version - 2011.1.519 and let us know how it goes.

    Best wishes,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  9. Steve
    Steve avatar
    18 posts
    Member since:
    Feb 2011

    Posted 27 May 2011 Link to this post

    I am using 2011.1.413.40.  I will give the new version a try.  I have also noticed that occasionally, as part of a routine I am using, the filter (.xlsx, .xls is what I have set) will not exist when I browse to upload a file.  I think it is because the instance is lost, and I have to create a new one.  The context is that I am checking to see if the file was already downloaded, and I am using a RadWindowManager.RadConfirm, and in order to capture the response, I have to call a web method on the Parent page.  When the method gets called on the User Control, the AsynchUpload instance is lost (null).  If I set the filters on the new instance, will that fix the issue?  Is there a better way to capture the response?

    Thanks
  10. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 01 Jun 2011 Link to this post

    Hello Steve,

    We have been alerted for a similar issue when the Silverlight module is used to upload files. Please try to use the Flash module instead. Here is a sample code to disable the Silverlight module:

    Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function() { return false; };


    Kind regards,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  11. Steve
    Steve avatar
    18 posts
    Member since:
    Feb 2011

    Posted 03 Jun 2011 Link to this post

    Thanks.  I will give the Flash option a try.  I have one other issue related to this control:

    RadWindowManager1.RadConfirm(nn, "confirmCallBackFn"330100null,"Prior Submission Detected");
    


    I am using the code above to render a popup if the user has already submitted for that period ('nn' is the message I convey, asking them id they want to overwrite the submission, in an OK-Cancel popup).  This code is in a User Control that call a Confirmcallback function on the parent page.  The callback captures the response, and if they select OK, it will run the code in a Code-behind Web Method to clear the submission.  The issue is that the UploadAsynch control loses it's state, and I can't reference it (the value is always null), so the file they were trying to upload is lost.  I tried just running the clear submission routing, and then the partial postback displays the message that the data has been cleared, and they need to re-select the file, and upload and process it again. This was shot down, so I need to get this to somehow not lose it's state.
            <script type="text/javascript">
                function confirmCallBackFn(arg) {
                    PageMethods.GetUploadFile(arg);
                    document.location.href = './UploadData.aspx';
                }

    Above is the callback. And here is the Web Method on the parent page:  I am forced the create a new instance of the User Control in order to call the remove_prior_entries method.  I'd appreciate a better way- I don't often use client side script to call server side code.  Thanks

            [System.Web.Services.WebMethod]
            public static void GetUploadFile(bool process)
            {// we would get here from the user control if the RADAsynchDowload control detected prior submissions
                if (!process)
                { HttpContext.Current.Session["Submitted"= false;
                  return;
                }
                else
                {
                    
                }
                upload_data _process = new upload_data();
                _process.remove_prior_entries();
            }

  12. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 07 Jun 2011 Link to this post

    Hi Steve,

    On every postback(even ajax postback) RadAsyncUpload control reset it's state. It is not possible to keep the state after the postback.

    All the best,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  13. Steve
    Steve avatar
    18 posts
    Member since:
    Feb 2011

    Posted 07 Jun 2011 Link to this post

    Is there an alternative to how I'm doing it?
  14. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 09 Jun 2011 Link to this post

    Hello Steve,

    My suggestion in your case is to check only client-side for duplicated submission with a web service without returning any html. That will reset the client state and after it submit the page.

    Best wishes,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017