Commit 0a4edc26 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Added file upload mock.

parent 137cf67d
* @author Rafael Ostertag <>
foreach ($_FILES as $key => $value) {
echo "$key";
echo file_get_contents($value['tmp_name']);
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<form id="myform">
<input name="fileupload" id="fileupload" type="file"></label>
<button id="doupload">Upload</button>
<pre id="display"></pre>
<script src="../js/jquery.min.js"></script>
$(function () {
$('#doupload').click(function (event) {
var data = new FormData();
$('input[type=file]').each(function (index, object) {
$.each(this.files, function (key, value) {
data.append($(object).attr('name') + '_' + key, value);
data.append('sip', 'sip_goes_here');
url: 'api/uploadhandler.php',
type: 'POST',
data: data,
cache: false,
processData: false,
contentType: false
}).done(function (data) {
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment