c# - Uploading files by dropzone.js give error, Request format is invalid: multipart/form-data; -
i using dropzone being able upload multiple files webservice, keep on getting error:
system.invalidoperationexception: request format invalid: multipart/form-data; boundary=----------wmbuh1mgt5uyai5sek0qnm. @ system.web.services.protocols.httpserverprotocol.readparameters() @ system.web.services.protocols.webservicehandler.coreprocessrequest()
this c# function
public bool invoketest(byte[] binaryarray, string docname)
as trying avoid page_load , try make work without form submit , jquery function as:
$('#dropzone').dropzone({ url: '_upload/uploader.asmx/invoketest', enctype: 'multipart/form-data', maxfilesize: 1, paramname: 'photos', addremovelinks: true, enqueueforupload: false, });
my form submit looks simple:
<form id="form1" action="_upload/uploader.asmx/invoketest" method="post" enctype="multipart/form-data" runat="server" class="dropzone">
my questions: possible use dropzone without "form" , post direct through jquery , avoid nasty error on webservice....
looking forward idea's , or suggestions,
thanks
dropzone.js work in conjunction webservice & more specifically, can used in scenarios, where
- you using form post webserviceurl
- you looking upload multiple images
, which, judging question, looking do.
here detailed example of such scenario. although in example servicestack (rather wcf) being used webservice: [ uploading images using servicestack , dropzone ]
this suggests webservice c# function not set correctly handle post request.
another important dropzone configuration use paralleluploads = 1. have seen being issue if multiple uploads looking access same memorystream on server-side implementation.
$('#dropzone').dropzone( { paralleluploads: 1, uploadmultiple: true, autoprocessqueue: true });
Comments
Post a Comment