Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
liq
upload image and save the URL in the database.

Upload the file to Uploads.  Then URL should show as http://localhost:4342/Uploads/abc.jpeg using liq to sql
Posted
Comments
Uday P.Singh 18-Jul-11 5:13am    
have you tried any thing?
[no name] 18-Jul-11 6:23am    
what you are using exactly r u looking this in sharepoint or on asp.net

upload image by using below link

http://hemantrautela.blogspot.in/2012/03/image-resize-in-aspnet-with-cnet.html[^]

and url you can change it for database (images/image.jpg)
 
Share this answer
 
I would suggest that you don't want to store the URL in the database - as the URL may change (as in your example, if this site was published, the URL would no longer be localhost.)

Instead, if you store the files in a folder called 'Uploads' you can safely just store the file name in the database, then if you need to retrieve the file, or provide its URL, you can build the URL using the known folder name and the filename from the database

If the folder may change, then just store the folder name and file name in the database

You can always provide the URL as ~\Uploads\abc.jpeg
 
Share this answer
 

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