Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

file upload javascript

<script>
async function uploadFile() {
    let formData = new FormData();           
    formData.append("file", fileupload.files[0]);
    await fetch('/upload.php', {
      method: "POST", 
      body: formData
    });    
    alert('The file has been uploaded successfully.');
}
</script>
Source by www.theserverside.com #
 
PREVIOUS NEXT
Tagged: #file #upload #javascript
ADD COMMENT
Topic
Name
5+2 =