Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Support for media upload #19

Closed
matepaiva opened this issue Jul 12, 2022 · 12 comments
Closed

[FEATURE] Support for media upload #19

matepaiva opened this issue Jul 12, 2022 · 12 comments
Assignees

Comments

@matepaiva
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I need to be able to upload images related to other collection types, but I am not sure if it is possible or how to do it. If it's possible, it would be good to be documented. I could help with that.

@Baboo7
Copy link
Owner

Baboo7 commented Jul 12, 2022

Uploading media is still under development. I'll notify you when it will be working.

What do you mean by upload images related to other collection types?

@matepaiva
Copy link
Contributor Author

I think we are talking about the same thing: the ability to upload images (and later relate it to other collection types ─ for example, an article can have a featured image.

Thank you for the feature development! Can I help you with something in this feature?

@cthom-dev
Copy link

Media upload would be fantastic.

@Baboo7
Copy link
Owner

Baboo7 commented Jul 14, 2022

I published version 1.6.4 that supports media upload. Check the Config section of the doc for proper setup.
I did a few tests and it seems to work properly but I'm waiting for your feedback

@matepaiva
Copy link
Contributor Author

@Baboo7 sorry, I couldn't understand how to use it to import the images. My use case is: I have a set of articles that have a featured image and, as I import the articles (from a json array), I want to be able to also import (upload) the featured image. Is that possible, for example?

@Baboo7
Copy link
Owner

Baboo7 commented Jul 14, 2022

You should be able to import the json and the images should be imported on the fly.
Can you share your json so I can see your file structure?

@matepaiva
Copy link
Contributor Author

I think that what is not clear to me is what I should have on the property article.featured_image, for example. The link to the image? Or the local path to the image?

@matepaiva
Copy link
Contributor Author

How can I upload featured_image on import?

articles.json:

[
  {
    "id": 5,
    "createdAt": "2010-03-10T17:07:44.000Z",
    "createdBy": 1,
    "updatedBy": 1,
    "publishedBy": 1,
    "publishedAt": "2010-03-10T17:07:44.000Z",
    "updatedAt": "2010-03-10T22:55:33.000Z",
    "title": "Primeiro \"bairro\" de Lisboa com representação em 3D",
    "slug": "primeiro-bairro-de-lisboa-com-representacao-em-3d",
    "excerpt": "",
    "content": "<p>De acordo com as pretensões do requerente e indo de encontro àquilo que entende ser as suas necessidades, propõe-se a edificação de um edifício composto por dois pisos, desenvolvendo-se em dois planos</p>",
    "featured_image": "https://www.anteprojectos.com.pt/wp-content/uploads/2010/03/35850b.jpg",
    "categories": [{ "id": 7 }, { "id": 8 }],
    "tags": [],
    "projects": [],
    "companies": []
  }
]

image

@Baboo7
Copy link
Owner

Baboo7 commented Jul 16, 2022

Based on your needs I published version 1.6.5. You'll be able to import the media using a url as you expect for featured_image.

Check out the Importing Data section of the doc.

@matepaiva
Copy link
Contributor Author

Thank you a lot @Baboo7! I will try it tomorrow and then I will give you some feedback :)

@Baboo7 Baboo7 closed this as completed Jul 31, 2022
@matepaiva
Copy link
Contributor Author

@Baboo7 sorry for the delay in the feedback, I was envolved in other projects as well. Today I tried it and it works very well!

Giving you additional feedback, I missed some features. If you wish, I could open a new issue.

Based on the current documentation, I sent the following media object:

[
  {
    "title": "test",
    "media": {
      "id": 31896,
      "url": "http://www.anteprojectos.com.pt/wp-content/uploads/2010/03/35850a.jpg",
      "name": "blablabla.jpg"
    }
  }
]

My thoughts on that are:

  • the id is not being respected. As I passed the url, it ignores the id, but it would be great to save that media with that id, although I am not sure that this is possible.
  • The name is not being respected.
  • it would be good to have the ability to set the alternativeText and caption.

Current result to the import above:

image

@Baboo7
Copy link
Owner

Baboo7 commented Aug 9, 2022

Great feedback 🙏

Can you open a Feature Issue with these suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants