Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
passing image files in post request parameter of JavaScript and then getting that image info in php

I am sending array of images and some text from javascript ajax function to php file and i can read text parameters but i cannot read image file parameters in php code how can i do that? Javascript code '''

formdata.append("file",img[i]);

xhttp.send("itemname="+itemname+"&category="+category+"&color="+color+"&price="+price
    +"&image="+formdata+"&brandname="+brandname+"&attributes="+attributes+"&smalldescp="+smalldesp
    +"&longdescp="+largedescp+"&warentyyear="+warentyyr+"&warentydescp="+warentypolicydescp+"&length="+pkglen
    +"&width="+pkgweight+"&height="+pkgheg);'''

Php Code '''

 $itemname = $_POST["itemname"];
   $category = $_POST["category"];
   $color = $_POST["color"];
   $price = $_POST["price"];
   $image =$_POST["image"];
   $brandname = $_POST["brandname"];
   $attributes = $_POST["attributes"];
   $smalldescp = $_POST["smalldescp"];
   $longdescp = $_POST["longdescp"];
   $warentyyear = $_POST["warentyyear"];
   $warentydescp = $_POST["warentydescp"];
   $length = $_POST["length"];
   $width = $_POST["width"];
   $height = $_POST["height"];
     
     echo json_encode($image->$_FILES['file']['name'][0]);

'''

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!