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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:09:45+00:00 2026-05-18T20:09:45+00:00

hitting a road block on this. what I have so far: <input id=newFile type=file/>

  • 0

hitting a road block on this.

what I have so far:

  <input id="newFile" type="file"/>
  <span style="background-color:orange;" onClick="newImage()">HEYTRY</span>

This is obviously not very far.

I am looking for a basic way to load this image into a variable, convert the variable to something passable via a URL (ajax) and then accomplish my goal via php once it can extract the bits from the url.

not as easy as I anticipated.

any help would be great.

thanks

  • 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-18T20:09:46+00:00Added an answer on May 18, 2026 at 8:09 pm

    This won’t work for every browser, but it’s a nice way of doing multiple file uploads via AJAX:

    function upload_files(entityKey, files, url, progress_callback) {
      var xhr = new XMLHttpRequest(), formData = new FormData();
      xhr.upload['onprogress'] = progress_callback;
    
      formData.append('entityKey', entityKey);
      $.each(files, function(i, file) { formData.append('file[]', file);});
    
      xhr.open("post", url, true);
      xhr.setRequestHeader("Cache-Control", "no-cache");
      xhr.send(formData);
    }
    

    The entityKey is an example of a parameter on the server. The ‘files’ parameter comes from the ‘files’ attribute of the file-type input form element (as an array to support multiple). The ‘progress_callback’ parameter is a function that takes an object that has (at least) a ‘loaded’ and a ‘total’ field (unit is bytes). It doesn’t care about the server response.

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

Sidebar

Related Questions

hitting a road block on this. what I have so far: <input id=newFile type=file/>
I've spent about 6 hours on this so far, and been hitting nothing but
I have been hitting a dead end with this program. I am trying to
I'm hitting a brick wall with this one- Here's the codethat I have -
When working with Spring Security + CAS I keep hitting a small road block
OK, I have done some creative searches and am kind of hitting a road
I'm hitting a wall with this, currently I have two web-service endpoints configured and
I am hitting this error when implementing core data. I have created a entity
I have been hitting my head against the wall trying to figure this out
I keep hitting road blocks with Django and have read about Pylons. Pylons seemed

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.