Click here to Skip to main content
15,909,091 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Is there a way to simulate drag-drop of a file to a website that uses FileReader interface(filereader.js) to upload file, using C#?

I want to programmatically upload file from my C# wpf app to a website that uses the FileReader interface to upload files. When you use the interface there isnt a link that you use to upload file, if there was a link behind upload i could easily upload there.

What I have tried:

I searched a lot online and havent found a way to simulate drag drop to a site that doesnt use a link.
Posted
Updated 21-Mar-17 6:16am
Comments
Richard MacCutchan 20-Mar-17 13:00pm    
You can only drop a file onto a website that will accept it.
Member 13063329 20-Mar-17 13:02pm    
It does accept it. I just dont know how to drop programmatically using C#.
Richard MacCutchan 20-Mar-17 13:08pm    
Nor me, but I would guess you need to simulate some actions that would normally be performed by the mouse. Try looking at the source of the website.
Member 13063329 20-Mar-17 13:10pm    
I did. But since JS is a new language for me, i havent gotten anywhere yet.
Richard MacCutchan 20-Mar-17 13:55pm    
It would make sense to learn the language before you try to use it.

 
Share this answer
 
Comments
Member 13063329 21-Mar-17 13:43pm    
It is not my site so i cannot change it to accept upload in a certain way. I need a way to programmatically upload a file to the site from my WPF windows app and grab output and format and display it in the app window.
Reading between the lines you want to upload files from the user system without their intervention, and if so that's not possible.
 
Share this answer
 
Comments
Member 13063329 21-Mar-17 13:40pm    
No. In the app the user will browse a file from the system and click upload and in the background the app has to upload that file to the site, grab output and format and display it in the app window.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900