Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Arturo Montejo Ráez
/
wbt-web-app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
49ca5910
authored
Apr 22, 2020
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
test with php55
parent
43d3de4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
application/controllers/Upload.php
application/helpers/upload_helper.php
application/controllers/Upload.php
View file @
49ca5910
...
...
@@ -8,11 +8,11 @@ class Upload extends CI_Controller {
public
function
upload
()
{
$this
->
load
->
helper
(
'upload'
);
if
(
ENVIRONMENT
==
'production'
)
{
$url
=
upload_to_bucket
(
'wbt2020.appspot.com'
,
'uploads'
);
}
else
{
//
if (ENVIRONMENT == 'production') {
//
$url = upload_to_bucket('wbt2020.appspot.com', 'uploads');
//
} else {
$url
=
upload_to_local
(
'./uploads'
);
}
//
}
$this
->
load
->
view
(
'upload'
,
array
(
'img_url'
=>
$url
));
}
...
...
application/helpers/upload_helper.php
View file @
49ca5910
...
...
@@ -28,7 +28,7 @@ function upload_to_bucket ($bucket_name, $path) {
// upload a file to local server filesystem
function
upload_to_local
(
$path
)
{
if
(
isset
(
$_FILES
[
'file'
]))
{
$config
[
'upload_path'
]
=
$path
;
$config
[
'upload_path'
]
=
'gs://wbt2020.appspot.com/uploads/'
;
//
$path;
$config
[
'allowed_types'
]
=
'gif|jpg|png'
;
$config
[
'max_size'
]
=
20480
;
// Max file size: 20480 = 20M
$config
[
'max_width'
]
=
2048
;
...
...
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