Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 538 characters in body
Source Link
more770
  • 65
  • 1
  • 13

I'm doing a form programmatically. I need to give an option to upload an image and give an option to resize it ( like cropping option ).

I don't know how to do it, I know that I need to upload the image to a directory and also I suppose that I need to show a relation between the node and the image in the database.

I've created a field called field_img.

So, how can I do it?

This is the form that I've done but I don't know how to give a relation in the database...

form['group_anuncio']['imagen'] = array(
        '#title' => t('Image'),
        '#type' => 'managed_file',
        '#upload_validators' => array('file_validate_extensions' => array('jpeg jpg png gif')),
        '#upload_location' => 'public://sites/default/files',
        '#progress_indicator' => 'throbber',
        '#status' => FILE_STATUS_PERMANENT,
        '#progress_message' => 'One moment while we save your file...',
);

I'm doing a form programmatically. I need to give an option to upload an image and give an option to resize it ( like cropping option ).

I don't know how to do it, I know that I need to upload the image to a directory and also I suppose that I need to show a relation between the node and the image in the database.

I've created a field called field_img.

So, how can I do it?

I'm doing a form programmatically. I need to give an option to upload an image and give an option to resize it ( like cropping option ).

I don't know how to do it, I know that I need to upload the image to a directory and also I suppose that I need to show a relation between the node and the image in the database.

I've created a field called field_img.

So, how can I do it?

This is the form that I've done but I don't know how to give a relation in the database...

form['group_anuncio']['imagen'] = array(
        '#title' => t('Image'),
        '#type' => 'managed_file',
        '#upload_validators' => array('file_validate_extensions' => array('jpeg jpg png gif')),
        '#upload_location' => 'public://sites/default/files',
        '#progress_indicator' => 'throbber',
        '#status' => FILE_STATUS_PERMANENT,
        '#progress_message' => 'One moment while we save your file...',
);

Unpload and Upload an image in a form programmatically

I'm doing programatically a form andprogrammatically. I need to give thean option to unpload andupload an image and give thean option to resize it ( like cropping option ). 

I don't know how to do it, I know that I need to unploadupload the image to a directory and also I suposesuppose that I need to show a relation between the node and the image in the database. I've

I've created a field call field_img.called field_img.

So, how can I do it?

Can anybody help me?

Thank you very much.

Unpload and image in a form programmatically

I'm doing programatically a form and I need to give the option to unpload and image and give the option to resize it ( like cropping option ). I don't know how to do it, I know that I need to unpload the image to a directory and also I supose that I need to show a relation between the node and the image in the database. I've created a field call field_img.

So, how can I do it?

Can anybody help me?

Thank you very much.

Upload an image in a form programmatically

I'm doing a form programmatically. I need to give an option to upload an image and give an option to resize it ( like cropping option ). 

I don't know how to do it, I know that I need to upload the image to a directory and also I suppose that I need to show a relation between the node and the image in the database.

I've created a field called field_img.

So, how can I do it?

Source Link
more770
  • 65
  • 1
  • 13

Unpload and image in a form programmatically

I'm doing programatically a form and I need to give the option to unpload and image and give the option to resize it ( like cropping option ). I don't know how to do it, I know that I need to unpload the image to a directory and also I supose that I need to show a relation between the node and the image in the database. I've created a field call field_img.

So, how can I do it?

Can anybody help me?

Thank you very much.