Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6370961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:59:55+00:00 2026-05-25T00:59:55+00:00

I have an html upload <input type=file id=myfile/> . When I click it, it

  • 0

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);"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:59:55+00:00Added an answer on May 25, 2026 at 12:59 am

    You can’t use file upload controls like that. The web browser prevents you from seeing local file paths. And I can’t tell if you are trying to write to the client’s machine, but you definitely cannot do that because it is a huge security risk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that contains an html file browse button ( <input type=file
I have a HTML file upload field from which I'm reading the file name
We have got an extjs 3.1.1 form with file upload field ( http://www.extjs.com/deploy/dev/examples/form/file-upload.html from
I have an upload script that write a index.html file, I modified it to
I tried to change the HTML form, input type file. Here is my code:
I have HTML page, which gives an option to upload a file to the
I have an HTML, PHP - Jquery form. The last input is a file
I have a basic upload form <html> <head> <title>Upload a File</title> </head> <body> <font
I have written a simple file upload script but it gives me the error
I have html code that looks roughly like this: <div id=id1> <div id=id2> <p>some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.