there is customer registration page where I follow this url https://blog.chapagain.com.np/magento-2-customer-image-file-upload-in-registration-account-page/ to add file upload field.

It is working fine but the problem is when I upload pdf file name with vendor's licence.pdf and click submit it throws 404 error: Page not found enter image description here if I rename file name to vendors licence.pdf then it went through without any error. I do not where I have to look at ? I tried to put die() function in /vendor/magento/module-customer/Controller/Account/createPost controller but no luck. how can I know where is the problem which file cause it? there is no any log. Please help

1 Answer 1


I suspect this is directly due to the space or the ' in your filename. I would suggest to search where is your full filename and to use a method to encode the url.

Something like

$originalUrl = 'http://myurl\'s withspace.pdf';
$encodedUrl = urlencode($originalUrl); 
  • it accepting space but not accepting single quote Commented Oct 12, 2023 at 21:16
  • my question is where to search? Commented Oct 12, 2023 at 21:17
  • well it seems to be that method no ? ` public function getCustomerLogoUrl($logoPath) { return $this->getMediaUrl() . 'customer' . $logoPath; }`
    – Claims
    Commented Oct 13, 2023 at 8:02
  • actually I am not using getCustomerLogoUrl function because I am using file upload only for document upload Commented Oct 13, 2023 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.