I have the following Fine Uploader code in markup in an aspx page in ASP.NET (not MVC) project:
<link href="../js/fineuploader/fineuploader-3.5.0.css" rel="stylesheet">
<script type="text/javascript" src="../js/fineuploader/fineuploader-3.5.0.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var uploader = new qq.FineUploader({
element: $('#fine-uploader')[0],
request: { /* <-- THIS IS WHAT I NEED TO FIGURE OUT */
endpoint: 'server/handleUploads'
},
autoUpload: true,
multiple: false,
text: {
uploadButton: '<asp:Button ID="fineUploadButton" runat="server" CssClass="button" style="width:6;5" Text="Browse" />'
},
validation: {
allowedExtensions: ['mp3', 'wav']
}
});
});
</script>
For the client side piece, this works fine. I've modified the fineuploader.css to get the exact look I want (mostly). With the client side piece being done I just need to handle this in my code-behind by handling the request endpoint
piece.
I've viewed several examples on the github page, but for ASP there are no non-MVC examples. Even the simplest of these examples involve creating a new class and inheriting from the Controller
class. Since I'm not doing this site with MVC, how can I handle the server side aspect of this?
My client side piece is pretty much complete, and I can supply more info on my server side code and organization if necessary.
Working with ASP.NET which is not an MVC project a WebHandler is needed for handling request seamlessly. For examples and usage of WebHandler see here.
With reference to SanthoshM's answer and inline with the combination of Fine Uploader MVC VB.net Server-Side sample, this is what i came up with. I hope this may be helpful to someone.
Client Side
Server Side
Kmarks2, it might be too late for you but this could help others.
To handle it server side in ASP.NET (not MVC) a WebHandler can be created. It is the Generic handler item with .ashx extension (e.g. FileUpload.ashx ).
The handler looks like this:
The endpoint should look like: 'http:// your server name/xxx/FileUpload.ashx' ( e.g.'http://localhost:3293/xxx/FileUpload.ashx')
Handling the requests sent by Fine Uploader is fairly trivial. All upload requests, by default, are multipart encoded POST requests. By default, all parameters are also present in the request payload as form fields.
I am not an ASP.NET developer, but it shouldn't be too difficult to handle MPE requests in ASP.NET. In fact, this is fairly trivial in most server-side languages. Here's an example of some code that should handle such a request:
Note that your server-side code must also return a valid JSON response. This is described more in Fine Uploader's server-side readme. There is an article on MSDN that describes dealing with JSON in .NET apps. Perhaps the
JsonConvert
class is required here.You can read more about handling these requests at http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-2.