Using input type="file" with ASP.Net and iPad and IIS's Windows Integrated Authentication - ios

I'm trying to do a really basic, no-frills file upload on a boring old HTML page using input type="file" that posts to an .aspx page, both hosted on IIS (both IIS7 and IIS8) with Windows Integrated Authentication enabled (not anonymous). It works just fine on Chrome for desktop, but if I use either Chrome or Safari on iPad, I can sign in (to get past Windows Auth) and see the form, but if I pick a file and click Send, it just sits and spins. If I don't pick a file, it works fine. If I switch from Windows Auth to Anonymous Auth, it works fine, even on the iPad. The file I'm picking is just from the iPad's photo library (originally taken with the built-in camera), and when testing Chrome for desktop, I'm testing with the exact same file (which is tiny, 1.4M).
Here's the default.html:
<!doctype html>
<html>
<head>
<title>Upload Test</title>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="upload.aspx">
<input type="file" name="foo" />
<input type="submit" value="Send" />
</form>
</body>
</html>
upload.aspx:
<%# Page Language="C#" CodeBehind="upload.aspx.cs" Inherits="UploadTest.Upload" %>
upload.aspx.cs:
using System;
using System.Web.UI;
namespace UploadTest
{
public partial class Upload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.Response.ContentType = "text/plain";
this.Response.Write("Got here");
this.Response.End();
}
}
}
Notice I don't even try to access this.Request.Files in the above, although if I do, for instance:
var file = this.Request.Files["foo"];
this.Response.Write("Filename: " + (file == null ? "(no file)" : file.FileName));
...I do see the filename in the cases where it works.
I don't have a Web.config: I just copied bin, default.html, and upload.aspx into a test directory under C:\inetpub\wwwroot and then used IIS Manager to convert that to an application with default settings, and switch from Anonymous Auth to Windows Auth. (But this is an MCVE of a much more complex project that did have a Web.config, I've just been stripping things back to the bone to find the problem.)
To recap:
Works just fine in Chrome on desktop
Works just fine on iPad if I don't pick a file
Works just fine on iPad if I switch to Anonymous Auth instead of Windows Auth and do pick a file
Spins forever on iPad if I'm using Windows Auth and pick a file using either Chrome or Safari for iPad
I'm not a big ASP.net guy. What am I doing wrong? Some config switch I need to flip?

I switched to using the Kerberos Security Authentication Protocol rather than NTLM protocol and uploads started working for me.

As far as I can tell, this is a bug in iOS (!), and it's fixed in iOS 11.0. The exact same configuration that doesn't work with v10.3 works with v11.
Unfortunately, iOS 11.0 will only be made available for 5th gen onward, so we've had to work around this by reading the file via the File API and sending it in batches to the server as non-file data. Ugly workaround, but it was the only thing that worked.

Related

flex row messing up during deployment in safari

ive got a next project with tailwind css. however a part of the css goes to hell during deployment, but locally its fine in Safari, in a mobile device. since i dont have an iphone i use an online emulator to simulate the error. the image below is what it looks like when deployed
however when i run it locally, as in i run localhost:3000 on the emulator. everything looks fine like so
Also, since this emulator allows me access to dev tools for which i used inspect. when i tried to turn off and on the flex css (you know when you open inspect, u see all the css styles and a checkbox to turn on or off that css). the display is perfect again! is this a bug or am i missing something?
the code i have above is a carousel and here is the code as follows, where the images i used a map function to display.
<div
className="flex flex-row snap-mandatory overflow-y-hidden !overflow-x-hidden scroll-smooth bg-black snap-x indiana-scroll-container indiana-scroll-container--hidescrollbars indiana-scroll-container--native-scroll"
// onScroll={(e)=>console.log(e.target.scrollLeft)}
ref={elementRef}
>
{
props.images.map(function(item){
return <div className="w-full flex-shrink-0 transform cursor-grab snap-center">
<Image
src={item}
width={100}
height={500}
className="w-[100%] sm:object-fill sm:w-full md:max-h-[350px] sm:max-h-[300px] lg:max-h-[450px] xl:max-h-[500px]"
unoptimized={true}
/>
</div>
})
}
</div>
i dont know whats wrong. everything works fine in chrome, but not in safari. and the part where turning on and off the flex manually fixes the display makes me think that my code isnt whats wrong.

Cannot select PDF files in Chrome iOS using Dropbox

I have an issue using Wordpress's Media Manager whilst using iOS Chrome browser. It won't allow me to select any PDF files. It works fine in Safari but was wondering if there is any restrictions on Chrome, Dropbox or iOS which is stopping a user from selecting it.
I have checked that all the correct "accepted types" are correct. I'm sure it's not that. (Wordpress has added .pdf and application/pdf to type="file")
Code:
iOS Chrome (59.0.3071.102) This is the exact code for our File Input:
<input id="html5_1bka" type="file" multiple="" accept="image/jpeg,.jpg,.jpeg,.jpe,image/gif,.gif,image/png,.png,image/bmp,.bmp,image/tiff,.tiff,.tif,.ico,.asf,.asx,video/x-ms-wmv,.wmv,.wmx,.wm,video/avi,.avi,.divx,video/x-flv,.flv,video/quicktime,.mov,.qt,video/mpeg,.mpeg,.mpg,.mpe,video/mp4,.mp4,video/x-m4v,.m4v,video/ogg,.ogv,video/webm,.webm,video/x-matroska,.mkv,video/3gpp,.3gp,.3gpp,video/3gpp2,.3g2,.3gp2,text/plain,.txt,.asc,.c,.cc,.h,.srt,text/csv,.csv,.tsv,.ics,.rtx,text/css,.css,text/html,.htm,.html,.vtt,.dfxp,audio/mpeg,.mp3,audio/x-m4a,.m4a,.m4b,.ra,.ram,audio/x-wav,.wav,audio/ogg,.ogg,.oga,.mid,.midi,audio/x-ms-wma,.wma,.wax,.mka,text/rtf,.rtf,application/x-javascript,.js,application/pdf,.pdf,.class,.tar,application/zip,.zip,.gz,.gzip,.rar,.7z,image/photoshop,.psd,.xcf,application/msword,.doc,application/vnd.ms-powerpoint,.pot,.pps,.ppt,.wri,.xla,application/vnd.ms-excel,.xls,.xlt,.xlw,.mdb,.mpp,application/vnd.openxmlformats-officedocument.wordprocessingml.document,.docx,.docm,application/vnd.openxmlformats-officedocument.wordprocessingml.template,.dotx,.dotm,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,.xlsx,.xlsm,.xlsb,.xltx,.xltm,.xlam,application/vnd.openxmlformats-officedocument.presentationml.presentation,.pptx,.pptm,application/vnd.openxmlformats-officedocument.presentationml.slideshow,.ppsx,.ppsm,application/vnd.openxmlformats-officedocument.presentationml.template,.potx,.potm,.ppam,.sldx,.sldm,.onetoc,.onetoc2,.onetmp,.onepkg,.oxps,.xps,.odt,.odp,.ods,.odg,.odc,.odb,.odf,.wp,.wpd,.key,.numbers,.pages,.bz2,.jpeg,.jpg,.mp4,.onetoc,.ppt,.tgz,.txz,.txt,.wpd,.xz,.jpe">
Screen shots:
I've seen another site working and looking at the code I could see that they didn't specify an "accept" attribute. I remove it and tested. It still doesn't allow PDF selection. Totally stumped.
Try removing all the file types in the accept attribute. Removing the entire attribute altogether didn't work for me.
Your input html should now look like:
<input id="html5_1bka" type="file" multiple="" accept="">
In order to fix this in Wordpress you might have to write a bit of custom JS to listen for wp.media, open event
How to Trigger some JavaScript when Media Popup is opened?

MVC app works fine in chrome, Firefox but not in IE11

I have a small MVC app, all this app must do is to take search string parameter via text-box and search the database return the data based on the parameter entered. This app works fine in the two of the browser that I have on my machine, it works in chrome and firefox but goes to complete freeze on IE11, it freezes so much so that it cannot even open developer tools nor respond to any click on the landing page.
I am not even too sure what code should I post because I doubt it has something to do with it and if does go down to code I am not sure which part because like I said it works perfect in chrome and firefox
I tried adding the line <meta http-equiv="X-UA-Compatible" content="IE=edge"> on the layout page but that made no difference whatsoever
Typically inability to open dev tools in a browser indicates that something intensive is running in a background. Try to open dev tools prior to entering URL of your application. Sometimes you can find some request looping forever, or wrong javascript.

JQuery Mobile Problems With Input Type File

So I want to use a document upload element in a web form using JQuery Mobile. Every mobile platform in my testing environment allows it, (only small additional styling is allowed but some none the less) until I come to IE and IE Mobile. It is all scew-whiff in both and doesn't function at all in IE Mobile.
Am I missing some secret documentation or am I being stupid expecting IE to behave like others... I am going to guess that yet again, they are laughing in the face of conformity.
Thank you for any input and advice.
In regards to code, I am not using anything fancier then:
<input name="exampleName" class="exampleClass" id="exampleDocument" type="file" size="250" value=""/>
<!--and Jquery Mobile changes the class name to input ui-input-text ui-body-a-->
IE for Windows Phone 7/8 as like iOS 5 and lower don't support file upload from web browser. File Upload Support

ASP.NET web site on IIS7 on Vista

I have dev an MVC app and deployed it to my local IIS as I am using dev server to dev.
This is on Vista Ultimate.
When i browse the site all the images are not showing and also the
login page is displayed.
what would be causing the images not to show and also why
the login page showed when I have not set up security
in web.config?
I tried to see if the ASPNET account had permissions
but there is user of that name and there is no
Add option in properies either.
Malcolm
This could be a deployment issue, rather than a permissions issue. Did you try to browse directly to an image via your browser?
So if you have an image located in your project as
\images\login.png
open in your browser to:
http://hostname/images/login.png
If this works, then you have got a referencing problem in your html. From memory, most images in asp.net mvc are located with:
src="../../images/login.png"
This could break down if your pathing is different to the current location.
I usually prefer this:
src="/images/login.png"
or even better:
src="<%= ResolveUrl("~/images/login.png")%>"
I had a problem with images displaying in an MVC app until I coded the image tags like this:
<img src="<%= Uri.Content("./content/images/image.png") %>" alt="text" />

Resources