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

RadAsyncUpload not working with Safari

4 Answers 110 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Paresh Sen
Top achievements
Rank 1
Paresh Sen asked on 15 Jul 2013, 06:43 PM

Hi,

I have created a basic asp.net application with below code:

<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" ChunkSize="1048576" />

When I run the application, files are getting uploaded to the app_data folder for IE\Chrome.

However, for safari the uploaded file is not having the valid file extension and sometimes it's not uploading the files.

There is no code added in cs file and the config file contains below configuration:

<system.webServer>

<security>

<requestFiltering>

<requestLimits maxAllowedContentLength="2199023255"/>

<fileExtensions allowUnlisted="true"/>

</requestFiltering>

</security>

<handlers>

<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" name="Telerik.Web.UI.WebResource"/>

</handlers>

<directoryBrowse enabled="true"/>

</system.webServer>


Any pointers will be appreciated.


Thanks.

4 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 27 Nov 2013, 04:22 PM
I have the exact same issue.  I am using a brand new iPad just purchased yesterday using Mobile Safari 7 and when I select a .jpg file (this is an allowed extension), the extension is not recognized as a valid extension.  My code is below.  I am also using Q3 2013 Telerik controls.

Any input from Telerik would be appreciated.  Thank you!

<telerik:RadAsyncUpload runat="server" ID="radUpload" OnClientFilesUploaded="OnClientFilesUploaded"

AllowedFileExtensions="jpg,jpeg,png,gif,bmp" MaxFileSize="1048576"

UploadedFilesRendering="BelowFileInput" AutoAddFileInputs="false"

OnFileUploaded="radUpload_FileUploaded"/>

0
Hristo Valyavicharski
Telerik team
answered on 28 Nov 2013, 04:38 PM
Hello,

Some files names that are valid on Mac/IOS devices are invalid for Windows. That's why they cannot be stored on a Windows File System. For example it is not possible to create a file without extension on a Windows machine. To workaround this issue you may handle RadAsyncUpload's OnClientValidationFailed event and tell the user that the uploaded file has invalid name:
function OnClientValidationFailed(sender, args) {
    var fileExtention = args.get_fileName().substring(args.get_fileName().lastIndexOf('.') + 1, args.get_fileName().length);
    if (args.get_fileName().lastIndexOf('.')!=-1) {//this checks if the extension is correct
        if (sender.get_allowedFileExtensions().indexOf(fileExtention)==-1) {
            alert("Wrong Extension!");
        }
        else {
            alert("Wrong file size!");
        }
    }
    else {
        alert("not correct extension!");
    }
}


Regards,
Hristo Valyavicharski
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
John
Top achievements
Rank 1
answered on 17 Dec 2013, 06:41 PM

Greetings,

I must not be explaining my situation correctly.

The RadAsyncUpload control works great if using IE, Chrome, etc. but not when I use the iPad Safari browser.  The uploaded item displays a red indicator next to the name of the file to be uploaded, as if to say the extension is not valid. 

Thanks!

0
John
Top achievements
Rank 1
answered on 17 Dec 2013, 07:03 PM

The issue was the MaxFileSize.  The image that I was trying to upload was too large.

Tags
Upload (Obsolete)
Asked by
Paresh Sen
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Share this question
or