angular-file-upload icon indicating copy to clipboard operation
angular-file-upload copied to clipboard

Drag and drop an already existing json file into uploader with clicking select or gettiung into file system

Open thrinay opened this issue 9 years ago • 5 comments

I have a view where in the left side I will be having the json file and on the right side we have the file uploader. I would just like to drag and drop the left side file to the file uploader . Is there any way to get this thing solved out. I did even try looking into all the issues but couldn't really find if anyone had faced it. Thank you

thrinay avatar May 24 '17 09:05 thrinay

can you assist with an image or screen shot of what you are trying to accomplish

theoomoregbee avatar May 24 '17 09:05 theoomoregbee

test demo

thrinay avatar May 24 '17 09:05 thrinay

If you carefully look. What i want is to drop the left side json file to the right. This is what the output should be. Let me know if you have any ideas concerning this. Thank you

thrinay avatar May 24 '17 09:05 thrinay

the best bet is for you to make your file link in the other view draggable, which i have done in this plnkr just to make sure draggable is working is to make each of your list which you want to be draggable hold this event dragstart , the below code should help you out to simulate file event sending

yourFileListItem.addEventListener("dragstart", function(event){
		   event.dataTransfer.setData("files", 
		   [{name:file.name, size:file.size, type:file.type}]);
		});

then check on how to make file in javascript, think that should help you

theoomoregbee avatar May 25 '17 11:05 theoomoregbee

Dear @theo4u , firstly don't mind for the delay. But whatever the plunker you posted or either the method is not working. AM sorry but, May I please have a plunker wherein you just drag an existing image in your view to the uploader, (In case if it doesn't kill your time a lot). Thank you

thrinay avatar Jun 21 '17 09:06 thrinay