Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot upload to Azure due to improper Url construction #1949
Type of issue
Fine-Uploader is prefixing the host site url to the Azure PUT request
Fine Uploader version
Browsers where the bug is reproducible
"Firefox" and "IE11" (and n/a)
Operating systems where the bug is reproducible
Exact steps required to reproduce the issue
All relevant Fine Uploader-related code that you have written
Detailed explanation of the problem
Check this out, this is the RAW request captured in Fiddler:
See anything wrong here? PUT should NOT be going to http://localhost:50021 at all! And you can also see that Fine-Uploader concatenated it with the proper Url wrapped in encoded double quotes (%22)
My signature code is the same as your C# server example, and I can confirm it returns the proper sas Url (https://xxxx.blob.core.windows.net/... ) WITHOUT being prefixed with the root of my site (http://localhost:50021). My site is ASP.NET MVC Core 2.0 (irrelevant, but interesting).
The issue appears to be within Fine-Upload js code somewhere, wherever it is appending things and ultimately making the request to Azure.
The issue isn't technically due to Fine Uploader, but Fine Uploader could be tweaked to handle this discrepancy.
ASP.NET MVC will treat string responses as JSON, and therefore will wrap "quotes" around output, and add the Content-Type "application/json" for you automagically. By adding a "Produces" attribute to the controller, it forces the Content-Type you want:
Yay! So yeah, File Uploader could be enhanced to trim junk like that, but it's really not the responsibility of the library IMO.
@rnicholus Just FYI, the docs are out of sync with the latest code on that parameter I highlighted above. it's
Honestly, I'm thinking about doing an entire .NET article. It was waaaay too much pain to put a simple thing together due to gotchas you just don't think about every day, and I was shocked to see no real ASP.Net examples out there. But yes, I will see what I can do about a PR for that at the very least.