1

Since I changed my drupal to my backup that it's giving me some errors, but overall it stills working, but today I was about to add a new content and when I try to upload new images it shows me this error

"The file could not be uploaded."

And in log messages I've this message errors:

Location: http://localhost/node/add/imovel?_wrapper_format=drupal_ajax&ajax_form=1&element_parents=field_image%2Fwidget

Message: The upload directory public://2017-02 for the file field field_image could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was cancelled.

In the same location this 2 other errors:

Recoverable fatal error: Argument 1 passed to Drupal\Core\Form\FormState::setError() must be of the type array, null given

Notice: Undefined index: value in Drupal\Core\Field\Plugin\Field\FieldWidget\NumberWidget->errorElement()

Now I can't upload images and that don't allow me to add new content. I already try to create a new field but that didn't work.

PS: I think the error has to do something about Image Crop because before this error happen a box to crop my image would appear after I upload and know I upload and no box to crop the image.. And when I press save and publish content the error pops

The specified file temporary://filekrGdEp could not be moved/copied because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions.

  • your first log message might be a permission issue or your public folder found in sites/default/files was deleted. Kindly double check. – John Rey Tanquinco Feb 13 '17 at 15:40
  • I have the folder in "/home/user/public_html/sites/default/files/2017-02" – racemi Feb 13 '17 at 15:54
  • I see... There is a missing field that is required to be filled in the manage form display of your content type that is set to disabled/hidden. – John Rey Tanquinco Feb 13 '17 at 16:01
  • What does any of that have to do with the image problem? – racemi Feb 13 '17 at 16:10
1

This sounds very much like a permission issue. Please check the permissions of

/home/user/public_html/sites/default/files/2017-02

The directory must be writeable for Drupal. Set its permissions at least to 710. You might want to set them for testing purposes to 755 or even 777 to see if your error messages disappear.

  • I already put my folder 'files' with permissions 777 and everything inside it. Didn't work, I'm going for a fresh start.. – racemi Feb 14 '17 at 10:57
  • Please check permissions of your temporary directory also. – upunkt Feb 14 '17 at 13:05
  • I also did that, I ask a buddy help and we were in that for over an hour and then he told me it was better to start over. Too many bugs, you fix one -> one more appears – racemi Feb 14 '17 at 13:15
0

Try setting private files path in settings.php to:

"../FOLDER_WITH_PRIVATE_FILES"

0

I was having this same error.

I didn't have important files in the folder. So I just deleted. Try to upload the file again, and it works, it created the folder and upload the files correctly.

If you already have files in the folder, you may just rename it, try the upload, and if it succeeds and creates the folder anew, you just move the files from the old folder to the new one.

Makes sense?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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