Question: 404 Not Found When Downloading Attached File

404 Not Found When Downloading Attached File

Hello, Everything is working fine so far. However, when I am trying to download the files (png, jpg) I have attached in the invoice, it's giving me 404 Not found error and can't download the

SK

Sarang Kim

Asked
Hello, Everything is working fine so far.
However, when I am trying to download the files (png, jpg) I have attached in the invoice, it's giving me 404 Not found error and can't download the files.

This is the link.
https://wujukorea.com/admin/welcome/download/74f159c08ac7ae322ae73a9cf8a4635d.png

Do you know what could be causing this?
  • MS

    Mian Saleem

    Answered
    Hello,

    Only logged in user have access to the admin area. You should be redirected to the login page.

    I am not sure why are you getting 404, please try login and download the file again and take screenshot of the page where you click the download button and the screenshot of the page after download clicked.

    Thank you
  • SK

    Sarang Kim

    Answered
    I was doing that as ADMIN and already was logged in.

    There is also another issue going one but i will make new thread about that.
  • MS

    Mian Saleem

    Answered
    Did you change the `index_page` or any other config?
  • SK

    Sarang Kim

    Answered
    No i did not change the index_page, i don't even know where that is.

    However, I just added this in the NGINX config

    ```
    # set expiration of assets to MAX for caching
    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
    expires max;
    log_not_found off;
    }
    location / {
    # Check if a file or directory index file exists, else route it to index.php.
    try_files $uri $uri/ /index.php;
    }
    location ~* \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    include fastcgi.conf;
    }
    location ~ /files {
    deny all;
    return 404;
    }
    }
    ```
  • MS

    Mian Saleem

    Answered
    Hello,

    Please let me know the owner account details in private reply to have look.

    Thank you
  • MS

    Mian Saleem

    Answered
    Hello,

    Please remove this and try again. I suspect, this is the cause.

    Thank you
  • SK

    Sarang Kim

    Answered
    If i remove that i will have 404 issue, because i am using NGINX engine no?

    can you check that for me please.
  • MS

    Mian Saleem

    Answered
    Hello,

    I am not good with servers. Just try to remove the location for file.

    I am using nginx on demo too.

    ```
    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }

    error_page 404 /index.php;

    location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
    }
    ```
  • SK

    Sarang Kim

    Answered
    No, it is still giving me 404 errors, and if i delete the

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    }

    whole website shows 404 error,
  • SK

    Sarang Kim

    Answered
    Whatever you told me to do , it's now working bro, I gave you access to everything.
    Please check for me.
  • Login to Reply