Click here to Skip to main content
11,920,211 members (44,621 online)
Rate this:
Please Sign up or sign in to vote.
Hello I have done project in that i can save image like downloading in to div then right click on that it displays save as image,I don't want to do like that. I want download image directly not like the above at the same time i want to save image path in database using SQL server and mvc3 web application.How to save in database I need to use any server side code.
I google it but couldn't find any relevant answer.
Is it possible what i asked if so can any one guide me.
Thanks in advance.
below code is for saving image
function downloadCanvas() {
        var canvas = stage.children[0].canvas;
        var oImgPNG = Canvas2Image.saveAsPNG(canvas, true);

the above code works for me with right click option.
I want to save image directly can any one guide me.When I search in google evry one is using php code.
how to use php code in html5.
Posted 19-Feb-13 22:01pm
Edited 21-Feb-13 20:06pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

We can store the file path of the image inside a VARCHAR column, but make sure the files are inside the server directory
geethika amu 20-Feb-13 4:22am
thanks for reply
Could you elaborate it because I am new to database
Arun1_m1 20-Feb-13 6:54am
You can have a column of type VARCHAR where you can store the address of the images in the directory.These addresses can be retrieved during operation and the actual image can be retrieved from the server directory.
geethika amu 20-Feb-13 7:08am
thanks for reply
I understood what you have said but can u tell me can we give the location like E:/Image/
is it possible to give in database
Arunprasath Natarajan 20-Feb-13 15:24pm
Yes you can. But keep this idea as optional.
Check out any other possibility to store the canvas element where as image can be stored in DB.
geethika amu 20-Feb-13 22:48pm
thank you for reply
do u know how to download image directly like image
the above code is working for download in div but i want to download directly in to system
can any one guide me

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

  Print Answers RSS
0 OriginalGriff 455
1 phil.o 170
2 CPallini 150
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,495
2 Sergey Alexandrovich Kryukov 3,153
3 George Jonsson 2,810
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web01 | 2.8.151120.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100