Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am building a vb.net app and i would like each and every user on the lan using the app to be able to upload pdf documents into the database and be able to retrieve them

What I have tried:

The logic i used was to store the file path into the database and retrieve it using a web browser but now that i am running the app on a different machine, it cant find the file since the file path is something like C:\Users\shadow\Documents\....
Posted
Updated 28-Sep-19 1:42am
Comments
F-ES Sitecore 27-Sep-19 8:56am    
Either store the documents in a folder on the server with the file path held in the database and stream the pdf file to the browser. Or store the actual PDF files themselves in the database as BLOBs and again stream the file to the user on request.

Lots of examples on line for doing both methods.
whatsapp myfriend 27-Sep-19 9:10am    
Can you help me with the code for storing and reading the actual pdf as Blob. I am using Mysql Server
F-ES Sitecore 27-Sep-19 9:52am    
https://www.google.com/search?q=mysql+c%23+store+and+retrieve+file+in+database

You can do a vb.net search too if you want but you'll probably get less results. Just translate the c# examples into vb.net. vb.net is not a good language for beginners as it's way harder to find examples.
whatsapp myfriend 27-Sep-19 10:15am    
okay
Richard Deeming 27-Sep-19 10:16am    
I've removed my solution, since it was for ASP.NET, and you clarified that this is a desktop application.

As F-ES Sitecore said, you'll need to upload the files to a file share on a central server. While you might be able to refer to the files on the user's computer using a UNC path, it wouldn't work if that computer was turned off.

1 solution

You could install a (lightweight) webserver or WAMP server and put the .PDF files in the server directory. That way users can also use a browser with the link including the file name to download the .PDF file they want.
You don't need to write a web application in PHP or other messy language for that.
Here is an overview of lightweight webservers: cross-platform-lightweight-http-servers[^]
Here is an overview of webserver packages: free-and-open-source-web-server-solution-stack-packages[^]
There are even portable WAMP packages like: USBWebserver[^] ideal for testing purposes !

Another option would be to write your own webserver, see example here: An HTTP file server (130 lines of code) in VB.Net - Stack Overflow[^]
 
Share this answer
 
v3
Comments
whatsapp myfriend 29-Sep-19 13:50pm    
@RickZeeland I'm actually building a desktop application in vb.net
RickZeeland 29-Sep-19 14:09pm    
See the update solution, added a suggestion for a file server in 130 lines of code :)
whatsapp myfriend 29-Sep-19 14:18pm    
Is there a way i can send you a snapshot of what i am building so that you can see what i actually want to do. Also i would like to make a correction on what i posted earlier. its actually a network share not a file server
RickZeeland 29-Sep-19 14:21pm    
Sorry, I'm not a VB.NET programmer, it would take me too much time !
whatsapp myfriend 29-Sep-19 14:24pm    
okay no problem thank you for your efforts

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