problem uploading production image with php

Asked

Viewed 9 times

0

I have a problem when creating an avatar for the user, in development environment everything goes right but in production it triggers the following error message: Error: file_exists(): open_basedir Restriction in Effect.

but upload occurs normally.

that is the code:

mkdir( $target_dir.$nome_pasta);
                    chmod( $target_dir.$nome_pasta, 0755);
                    copy("${target_dir}/avatar-user-placeholder.jpg", "${target_dir}/${nome_pasta}");  
               

1 answer

0

File/ folder permissions do not let you add a file.

Also check what type of environment you are using, normally linux based environments tend to use a temporary folder (tmp) before effectively uploading the file.

Your code apparently there’s nothing wrong.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.