-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload file failed #32
Comments
Hi @MikeMaldini , Can you provide more detail like your Nginx settings, laravel version, error message or any other information? |
@albertcht Yes i find some problem, when i didn't use proxy, i upload file it will upload in |
Hi @MikeMaldini , Do you mean your uploading works properly using this package but without Nginx proxy? If yes, I think you still need to provide your Nginx settings. |
@albertcht That's my nginx config # Default server configuration
#
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
server_tokens off; # Hidden Server Version
add_header X-Xss-Protection "1; mode=block"; # XSS Protect Header
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; # HSTS Header
root /var/www/Personal.Blog/public;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name mikeblog.site;
location = /index.php {
# Ensure that there is no such file named "not_exists"
# in your "public" directory.
try_files /not_exists @swoole;
}
location / {
try_files $uri $uri/ @swoole;
}
location @swoole {
set $suffix "";
if ($uri = /index.php) {
set $suffix "/";
}
proxy_set_header Host $host;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# IF https
proxy_set_header HTTPS "on";
proxy_temp_file_write_size 1000k;
proxy_pass http://127.0.0.1:1215$suffix;
}
} |
Hi @MikeMaldini , I test my upload feature with the same Nginx config, and the file goes to correct location Probably nothing to do with Nginx config, can you provide partial code about your upload logic? |
@albertcht Yes, its my code, i use ...
$Str_Path_High = strtolower('STORAGE') . '/' . 'Original' . '/';
$Arr_Path['High'] = $Str_Path_High . $Str_Encrypt_FileName;
if( is_dir( $Str_Path_High ) == false ) mkdir( $Str_Path_High );
$Obj_Image_High = Image::make( $StrObj_File ) ->save( $Arr_Path['High'] );
... |
Check out https://laravel.com/docs/5.6/requests#storing-uploaded-files and https://laravel.com/docs/5.6/filesystem . Use of Laravel's filesystem is encouraged over your own (kinda messy...) implementation. |
Hi @MikeMaldini , Sorry for having difficulty finding any clues out from your code. Maybe you can try to dump the value of |
@emielmolenaar Thanks |
@albertcht Ye,i find some solution, anyway thanks due |
When I Use Nginx Proxy, Image upload didn't work, Where can the problem occur?
The text was updated successfully, but these errors were encountered: