Import Images and Add to the Entity 'CarPicture'

Hello Everybody!

Here's what I have:

- 2 Enitties, Car and CarPicture; (CarPicture Entity still empty)

- Folder with Pictures of each Car;


What I want:

- To fetch all the pictures from the Folder, then to be added to the CarPicture Entity, so they automatically are linked to the Car which they belong.

+ Info: Mine final goal is to show on the CarDetail Screen, the specific Picture of each car, without have to Upload each one by hand.


Thanks in advance,

ruipmoura





Hello Rui,


What have you tried so far? You seem to have the idea well structured, so it's a matter of splitting it into smaller tasks and accomplish them.

You have a folder with pictures. Where is that folder? On a remote server? Or on your machine? Depending on the answer, the process will change.

For a remote server, you just need a way to retrieve and copy the files into your DB. If they are on your machine, you'll need to implement a upload process for it. (For the sake of simplicity, I'm not even going to suggest an excel sheet with the Base64 representation of the images)

Now, you'll need to have a way to match your pictures with your cars, right? The only "automatic" way I could see is to map the filename to something in your car entity, making sure it is unique.

So, yeah. This should be a good starting point.


Cheers!

Armando Gomes,

Answering your first question, the Pictures folder is on my machine.

"Now, you'll need to have a way to match your pictures with your cars, right? The only "automatic" way I could see is to map the filename to something in your car entity, making sure it is unique."

Yeah, it was the way a friend of mine suggested, also He added I should create a Timer with the Action to upload them, but my main doubt it's to implement this logic to pick them by their filename.


Thanks ;)






The timer won't be able to retrieve data from your machine without you opening a connection between both systems and all those very cool things. The simplest way for you to do that would be to have an Excel sheet with the Base64 values - which I don't recommend.

Just use one of those Multiple File Uploads components on forge so you can simplify the process. You can stage the data into an entity and then use a timer to process it.

Armando Gomes wrote:

Just use one of those Multiple File Uploads components on forge so you can simplify the process. You can stage the data into an entity and then use a timer to process it.

Any advices on this step will be welcome :)


Download a component, try to use it (select one with a demo, usually it helps) and come back if you have any questions or issues.

It's a bit to much for me with the current knowledge I have...



If the current knowledge that you have seems to not be enough, I would suggest to go over the training material. You'll have examples of how to handle files uploads, how timers work, etc. 

Although OutSystems aims to reduce the learning curve, it still has a learning curve.

I'm a huge fan of "Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime".

So, knowing this, my suggestions:

- Review the training material for what you're trying to achieve, or everything if you skipped it.

- Understand how uploads work

- Understand how timers work

- Understand the concept of staging

- Understand how to install and use a component from the Forge, specially if it has a demo. Check this one.


Have fun!