Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
75ff105f
Commit
75ff105f
authored
Jul 01, 2021
by
Anthony.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
File Upload Tester
parent
14e476b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
checkfiles.php
test/upload/checkfiles.php
+10
-0
fileform.php
test/upload/fileform.php
+15
-0
process.php
test/upload/process.php
+27
-0
No files found.
test/upload/checkfiles.php
0 → 100644
View file @
75ff105f
<?php
if
(
@
file_exists
(
"imgdir"
)){
$files
=
array_diff
(
scandir
(
"imgdir"
),
array
(
'.'
,
'..'
));
foreach
(
$files
as
$file
){
echo
"
{
$file
}
<br/>"
;
}
}
test/upload/fileform.php
0 → 100644
View file @
75ff105f
<!DOCTYPE html>
<html
lang=
"lang"
>
<head>
<title>
File Upload Tester
</title>
</head>
<body>
<form
action=
"process.php"
method=
"POST"
enctype=
"multipart/form-data"
>
<input
type=
"file"
accept=
"image/jpeg,image/png,image/jpg,image/gif,application/pdf"
id=
"img1"
name=
"img1"
/>
<br/>
<br/>
<input
type=
"submit"
value=
"Submit"
/>
</form>
</body>
</html>
\ No newline at end of file
test/upload/process.php
0 → 100644
View file @
75ff105f
<?php
function
loadImageAds
()
{
$path
=
"imgdir"
;
// 該当ディレクトリの確認
if
(
!
file_exists
(
$path
))
mkdir
(
$path
,
0777
);
else
chmod
(
$path
,
0777
);
$saveName
=
basename
(
$_FILES
[
"img1"
][
"name"
]);
print_r
(
$_FILES
);
if
(
move_uploaded_file
(
$_FILES
[
"img1"
][
"tmp_name"
],
"
{
$path
}
/
{
$saveName
}
"
))
{
chmod
(
"
{
$path
}
/
{
$saveName
}
"
,
0777
);
return
true
;
}
return
false
;
}
if
(
loadImageAds
()){
echo
"<br/><br/>File Uploaded!"
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment