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 9173581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:36:43+00:00 2026-06-17T16:36:43+00:00

<div class=hideAfterSuccess> <label for=avatar>Upload an Avatar :</label> <input type=file name=avatar id=avatar /> </div> and

  • 0
<div class="hideAfterSuccess">
                    <label for="avatar">Upload an Avatar :</label>
                    <input type="file" name="avatar" id="avatar" />
                </div>

and below is the jquery that has to pass image location to a php function in another file (parsePortal.php). am able to pass other kinds of data o the file but the image failed. i thought since it posts the location string of the image, i would be able to use $_FILES[$_POST[‘image’]][‘name’] and then upload the image. i have tried the web, surely, didn’t find what i needed.

        $(function(){
           var imageLoc = $('avatar').val();
           var url = "parsePortal.php";
                $.post(url, {
                    status : "getimage",
                    image : "imageLoc"
                }, function(result){

                 });
            });
  • 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-06-17T16:36:44+00:00Added an answer on June 17, 2026 at 4:36 pm

    i successfully did it using the jquery forms plugin.
    this means it sent the whole path from which i got the the file name and printed it out. THANKS TO YOU VIC, there is no way i c’d have done this without this kind of help.

    here is the javascript.

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> 
    <script src="http://malsup.github.com/jquery.form.js"></script> 
    
    <script> 
            // prepare the form when the DOM is ready 
            $(document).ready(function() { 
                // bind form using ajaxForm 
                $('#htmlForm').ajaxForm({ 
                    // target identifies the element(s) to update with the server response 
                    target: '#htmlExampleTarget', 
    
                    // success identifies the function to invoke when the server response 
                    // has been received; here we apply a fade-in effect to the new content 
                    success: function() { 
                        $('#htmlExampleTarget').fadeIn('slow'); 
                    } 
                }); 
            });
    </script> 
    

    and here is the html

    <form id="htmlForm" action="file.php" method="post"> 
    Message: <input type="text" name="message" value="Hello HTML" /> <p></p>
    Image : <input type="file" name="image" id="image" /><p></p>
    <input type="submit" value="Echo as HTML" /> 
    

    and here is the php

    $image =  $_FILES['image']['tmp_name'];
    $name = $_FILES['image']['name'];
    move_uploaded_file($image, "uploads/".$name);
    echo '<div style="background-color:#ffa; padding:20px">' . $_POST['message'] .  '</div>'; 
    echo '<img src="uploads/'.$name.'"/>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a box that has the div class box_1 assigned to it. Now
How to get ul class name while clicking li - jquery <div class=div-class-parent> <div
<div class = 'buttons'> <button type=submit class=regular name=save> <img src=elephant.png alt=/> Memory </button> </div>
I have a div class named switch control which has a div class named
JQuery-ui will generate a div with a calendar-div class. Sadly this div is no
My div with class name 'header-body-right' doesn't seem to be floating to the left
I need to access div class using label class. The Logic is on placing
How can I get DIV id or DIV class using Jquery if the HTML
I have some class like this <div class = student> <div class = name>Adam
In this code: soup=BeautifulSoup(program.Description.encode('utf-8')) name=soup.find('div',{'class':'head'}) print name.string.decode('utf-8') error happening when i'm trying to print

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.