Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
wallet
token
Commits
b300fa5d
Commit
b300fa5d
authored
Sep 07, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
50643e9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
Uploader.php
common/components/uploader/Uploader.php
+8
-6
No files found.
common/components/uploader/Uploader.php
View file @
b300fa5d
...
@@ -37,15 +37,18 @@ class Uploader extends Component
...
@@ -37,15 +37,18 @@ class Uploader extends Component
/**
/**
* 上传文件
* 上传文件
* @param $uploaded_file UploadedFile
* @param $uploaded_file UploadedFile
* @param $savename string 文件保存名
* @param $savename string 文件保存名
* @return bool|string 文件rui or false
* @throws Exception
* @throws Exception
* @return bool|string 文件rui or false
*/
*/
public
function
upload
(
$uploaded_file
,
$savename
=
''
)
public
function
upload
(
$uploaded_file
,
$savename
=
''
)
{
{
if
(
empty
(
$savename
))
{
if
(
empty
(
$savename
))
{
$savename
=
md5
(
date
(
'Y-m-d H:i:s'
)
.
$uploaded_file
->
tempName
)
.
'.'
.
$uploaded_file
->
extension
;
$savename
=
md5
(
date
(
'Y-m-d H:i:s'
)
.
$uploaded_file
->
tempName
);
if
(
$uploaded_file
->
extension
)
{
$savename
=
$savename
.
'.'
.
$uploaded_file
->
extension
;
}
}
}
$this
->
absolute
=
rtrim
(
str_replace
(
'\\'
,
'/'
,
$this
->
absolute
),
'/'
)
.
'/'
;
$this
->
absolute
=
rtrim
(
str_replace
(
'\\'
,
'/'
,
$this
->
absolute
),
'/'
)
.
'/'
;
...
@@ -68,4 +71,4 @@ class Uploader extends Component
...
@@ -68,4 +71,4 @@ class Uploader extends Component
}
}
}
}
}
}
\ 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