Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
qfq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
typo3
qfq
Commits
0a4edc26
Commit
0a4edc26
authored
8 years ago
by
Rafael Ostertag
Browse files
Options
Downloads
Patches
Plain Diff
Added file upload mock.
parent
137cf67d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mockup/api/uploadhandler.php
+12
-0
12 additions, 0 deletions
mockup/api/uploadhandler.php
mockup/upload.html
+49
-0
49 additions, 0 deletions
mockup/upload.html
with
61 additions
and
0 deletions
mockup/api/uploadhandler.php
0 → 100644
+
12
−
0
View file @
0a4edc26
<?php
/**
* @author Rafael Ostertag <rafael.ostertag@math.uzh.ch>
*/
var_dump
(
$_POST
);
foreach
(
$_FILES
as
$key
=>
$value
)
{
echo
"
$key
"
;
echo
file_get_contents
(
$value
[
'tmp_name'
]);
}
This diff is collapsed.
Click to expand it.
mockup/upload.html
0 → 100644
+
49
−
0
View file @
0a4edc26
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Upload
</title>
</head>
<body>
<form
id=
"myform"
>
<label>
File
<input
name=
"fileupload"
id=
"fileupload"
type=
"file"
></label>
<button
id=
"doupload"
>
Upload
</button>
</form>
<pre
id=
"display"
></pre>
<script
src=
"../js/jquery.min.js"
></script>
<script>
$
(
function
()
{
$
(
'
#doupload
'
).
click
(
function
(
event
)
{
event
.
preventDefault
();
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
'
);
$
.
ajax
({
url
:
'
api/uploadhandler.php
'
,
type
:
'
POST
'
,
data
:
data
,
cache
:
false
,
processData
:
false
,
contentType
:
false
}).
done
(
function
(
data
)
{
$
(
"
#display
"
).
empty
().
append
(
data
);
});
});
});
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment