This is a migrated thread and some comments may be shown as answers.

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

12 Answers 238 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 19 May 2011, 08:11 PM
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

12 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 20 May 2011, 12:53 PM
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.
0
Steve
Top achievements
Rank 1
answered on 20 May 2011, 02:42 PM
Yes- I used AsynchUpload for that reason.  Works fine.  Thanks
0
Steve
Top achievements
Rank 1
answered on 20 May 2011, 07:49 PM
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
0
Peter Filipov
Telerik team
answered on 24 May 2011, 12:48 PM
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.

0
Steve
Top achievements
Rank 1
answered on 25 May 2011, 03:56 PM
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
0
Peter Filipov
Telerik team
answered on 27 May 2011, 03:09 PM
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.

0
Steve
Top achievements
Rank 1
answered on 27 May 2011, 03:30 PM
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
0
Peter Filipov
Telerik team
answered on 01 Jun 2011, 04:16 PM
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.

0
Steve
Top achievements
Rank 1
answered on 03 Jun 2011, 03:57 PM
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();
        }

0
Peter Filipov
Telerik team
answered on 07 Jun 2011, 12:42 PM
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.

0
Steve
Top achievements
Rank 1
answered on 07 Jun 2011, 05:24 PM
Is there an alternative to how I'm doing it?
0
Peter Filipov
Telerik team
answered on 09 Jun 2011, 01:29 PM
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.

Tags
Upload (Obsolete)
Asked by
Steve
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Steve
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or