Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

file upload in php through ajax

async function saveFile() 
{
    let formData = new FormData();           
    formData.append("file", sortpicture.files[0]);
    await fetch('/uploads', {method: "POST", body: formData});    
    alert('works');
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #file #upload #php #ajax
ADD COMMENT
Topic
Name
9+8 =