You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm using the lib compressor to compress the file on client side before upload it to an azure container. he copress occurr with success but the uploaded version is always the original version.
my code:
varmyDropzone=newDropzone(id,{url: "/Image/Upload",dictInvalidFileType: "Apenas arquivos jpeg ou jpg são suportados",dictUploadCanceled: "Upload cancelado",dictFileTooBig: "Arquivo muito grande ({{filesize}}MiB). Máx. permitido: {{maxFilesize}}MiB.",dictInvalidFileType: "Tipo de arquivo não permitido.",autoProcessQueue: true,autoQueue: true,method: "PUT",headers: {"x-ms-blob-type": "BlockBlob","x-ms-version": "2017-11-09"},clickable: true,maxFilesize: MAX_FILE_SIZE,createImageThumbnails: false,acceptedFiles: ".jpeg,.jpg",previewTemplate: previewTemplate,previewsContainer: id + " .dropzone-items",transformFile: function(file,done){newCompressor(file,{quality: 0.6,success(compressedFIle){done(compressedFIle);},error(err){done(file);}});},sending: (file,xhr)=>{//Tosendfilewithoutwrappintngittomultipart/form-data,//Azurewon’tunwrapitconst_send=xhr.send;xhr.send=()=>{_send.call(xhr,file)};},renameFile: function(file){return`${Date.now()}___${userid}___${projectid}___${file.name}`;},init: function(){constdz=thisdz.on("processing",(file)=>{dz.options.headers["Content-Type"]=file.type;})},accept: function(file,done){
// code to check if file already exists } }); myDropzone.on("processing", function (file) { // Ineedtodoanasynccallhere,togettheURL...
setSasUrl(file,myDropzone);});
// Adicioneumouvinteparaoevento`addedfile`myDropzone.on("addedfile",function(file){controlFileAdded(file,dropzone);});//uploadprogressmyDropzone.on('uploadprogress',(file,progress,bytesSent)=>{constprogressBar=file.previewElement.querySelector(".progress-bar");progressBar.style.width=progress + "%";});//sendingmyDropzone.on("sending",function(file){//ShowthetotalprogressbarwhenuploadstartsconstprogressBar=file.previewElement.querySelector(".progress-bar");progressBar.style.opacity="1";});//completemyDropzone.on("complete",function(file){removeFile(myDropzone,file);});//resetmyDropzone.on("reset",function(){sentFiles=0;addedFiles=0;errorFiles=0;setTotalProgress();});myDropzone.on("success",function(file){sentFiles += 1;setTotalProgress();});};functionsetSasUrl(file,myDropzone){
//codeogettheupatedSASURL.}functioncontrolFileAdded(file,dropzone){
//codetoadjustproggressbars}
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm using the lib compressor to compress the file on client side before upload it to an azure container. he copress occurr with success but the uploaded version is always the original version.
my code:
The text was updated successfully, but these errors were encountered: