Click here to Skip to main content
15,923,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
Can anyone guide or provide any sample project regarding this.

Mine requirement is this i need an scanning application in mvc which initially scan file and then save that file in db.

Thanks in advance.

What I have tried:

twain printing app i have tried, but need some working application sample for reference
Posted
Updated 3-Jul-18 23:53pm
Comments
F-ES Sitecore 4-Jul-18 5:33am    
Files on the client? Files on the sever? Files somewhere else? Are you uploading these files? What does the scanning entail?

Google "mvc upload file" and "mvc save file in database" and you should find examples of some of these things.
Member 3967988 4-Jul-18 5:40am    
files on server. like when click on button scanning start and that scanned image save on sever.
F-ES Sitecore 4-Jul-18 6:17am    
I'm going to assume you want to scan files from a scanner attached to the client and upload them to the web server. To do that you'll need a scanner that comes with software that allows a webpage to access it as there is no native support for that in html, however features like access to devices will eventually come to html5. Or you can use a TWAIN SDK that works with js\html, if you google you'll find some.

1 solution

string dirPath = @"C:\"; // your directory path for files
string filter = "*.*"; // if you want any specific type give it here. ex: *.txt
string[] files = Directory.GetFiles(dirPath, filter);

foreach (string file in files)
{
// logic to read file and save content in DB
}
 
Share this answer
 
Comments
Member 3967988 4-Jul-18 5:57am    
thanks, but first i want to scan file through scanner and have to save that file.
tarunsingh 4-Jul-18 6:01am    
Do you want to scan on click of your application? if yes, It depends on your scanner.
If you have twain compatible scanner, You can use TWAIN API.
or you can use some third party libraries which gives you freedom to play with scanning and imaging process.
Member 3967988 4-Jul-18 6:20am    
Yes, i want to scan file on click in my application, and then after scan finish i need to save that image . i need to do that in mvc

can you please share me any reference or any sample project for this.

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