I have an html upload <input type="file" id="myfile"/>. When I click it, it is loading the file but cant get whole path like c:documents/images... etc in firefox3.
I also have an html button on click I have to save the file to my root folder of application using json when the image is saved, then a popup should open with the browsed image, allowing the user to to crop the image using jcrop. When the user is done cropping, the image should be saved back to my root folder (server side) using jquery and json and using only html controls.
Everything should be handled with jquery and json and in the code behind using webmethods.
Here is my code:
<input type="file" class="select-file" id="file_attach" />
enter code here
$('#btnNextPhoto').click(function () {
//Cancel the link behavior
filename = $('#file_attach').val();
//e.preventDefault();
if (filename != "") {
alert("i am svaing");
SaveUncroppedImage();
}
}
function SubmitUncroppedImage(image) {
var ticket = getCookieFromPage();
var DTO = JSON.stringify({ image: image, encryptedTicket: ticket });
$.ajax({
type: "POST",
url: "../Members/EditProfile.aspx/SaveUncroppedImage",
data: DTO,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
alert(msg.d);
$("#cropbox").attr('src', msg.d).show();
$('#container').hide();
},
error: function (msg) {
alert(msg.d);
}
});
}
[System.Web.Services.WebMethod]
public static string SaveUncroppedImage(string image, string encryptedTicket)
{
ImageFunctions img = new ImageFunctions();
string guid = Guid.NewGuid().ToString();
string fileName = guid + ".jpg";
//string rPath = "/images/flower.jpg";
string root = "C:\\Sites\\images\\videothumbs";
file_attach.SaveAs(root + image);"