Click here to Skip to main content
Rate this: bad
good
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);
        document.body.appendChild(oImgPNG);
      }
 
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
v3

1 solution

Rate this: bad
good
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
  Permalink  
Comments
geethika amu at 20-Feb-13 4:22am
   
thanks for reply
Could you elaborate it because I am new to database
Arun1_m1 at 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 at 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 at 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 at 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 5,170
1 DamithSL 4,357
2 Maciej Los 3,750
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,851


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2014
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