New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Adobe AD0-E704 Exam - Topic 9 Question 51 Discussion

Actual exam question for Adobe's AD0-E704 exam
Question #: 51
Topic #: 9
[All AD0-E704 Questions]

You are creating a module lo enable customers to attach an image file to the quote items while adding a product to the cart. To save development time, you want to build on top of functionality provided by the class \Magento\Catalog\Model\ImageUploader as much as possible.

The class constructor signature is:

What do you do to process the uploaded file?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

0/2000 characters
Hildegarde
3 months ago
D is interesting, but I’m not sure about the virtual type thing.
upvoted 0 times
...
Reta
3 months ago
C looks solid, but it sounds like extra work.
upvoted 0 times
...
Erasmo
3 months ago
Wait, can we really use the ImageUploader for quote items?
upvoted 0 times
...
Thaddeus
4 months ago
I disagree, B might be the better choice since it’s for quote items.
upvoted 0 times
...
Rebecka
4 months ago
Option A seems like the quickest way to go!
upvoted 0 times
...
Kristofer
4 months ago
I remember we talked about virtual types, but I'm not clear on how to specify the base paths and allowed extensions for this case.
upvoted 0 times
...
Salome
4 months ago
I feel like option C sounds familiar, but I can't recall if we actually discussed implementing the UploaderPoolInterface in detail.
upvoted 0 times
...
Maddie
4 months ago
I'm not entirely sure, but I remember something about configuring plugins in di.xml. Could that apply here?
upvoted 0 times
...
Galen
5 months ago
I think we might need to create a custom implementation since the ImageUploader is specifically for catalog images, right?
upvoted 0 times
...
Salena
5 months ago
I'm leaning towards Option D. Configuring a virtual type based on the ImageUploader class and specifying the base paths and allowed extensions seems like a good compromise between leveraging the existing functionality and customizing it for the quote item use case.
upvoted 0 times
...
Paris
5 months ago
Option C seems like the most flexible approach. Creating a custom ImageUploader implementation and adding it to the UploaderPool would allow me to fully control the file handling process for the quote items. It's a bit more work, but it's probably the most robust solution.
upvoted 0 times
...
Kenneth
5 months ago
Hmm, I'm a bit unsure about this one. The question mentions that the files are associated with quote items, not catalog products. I'm not sure if the ImageUploader class can handle that use case, so Option B might be the safer choice and require a custom implementation.
upvoted 0 times
...
Luke
5 months ago
I think the key here is to leverage the existing ImageUploader class as much as possible to save time. Option A looks like the easiest approach, just configuring a plugin to override the moveFileFromTmp() method.
upvoted 0 times
...
Nicolette
1 year ago
Haha, you know what they say - 'If it ain't broke, don't fix it!' But in this case, it sounds like the existing ImageUploader might not be the perfect fit. Gotta get creative, right?
upvoted 0 times
...
Youlanda
1 year ago
I'm not sure about option B. If the catalog ImageUploader can't be used for quote items, that seems like a code smell to me. I'd try to find a way to extend the existing functionality.
upvoted 0 times
Ona
1 year ago
I agree, extending the existing functionality seems like the best approach to maintain code consistency.
upvoted 0 times
...
Alise
1 year ago
C) Create a custom Class implementing \Magento\Catalog\Model\ImageUploaderInterface and add it to the $uploaders argument of the UploaderPoolinterface via di.xml
upvoted 0 times
...
Werner
1 year ago
A) Configure a plugin for the method \Magento\Catalog\Model\ImageUploader: moveFileFromTmp() in di. xml
upvoted 0 times
...
...
Lou
1 year ago
I personally think option D) Configure a Virtual type based on \Magento\Catalog\Model\ImageUploader Specifying $baseTmpPath, $basePath and SallowedExtensions is the most efficient solution.
upvoted 0 times
...
Kristian
1 year ago
Option D sounds like a good idea too. Configuring a virtual type based on the existing ImageUploader class could save a lot of time and effort.
upvoted 0 times
Richelle
1 year ago
Option D sounds like a good idea too. Configuring a virtual type based on the existing ImageUploader class could save a lot of time and effort.
upvoted 0 times
...
Irma
1 year ago
C) Create a custom Class implementing \Magento\Catalog\Model\ImageUploaderInterface and add it to the $uploaders argument of the UploaderPoolinterface via di.xml
upvoted 0 times
...
My
1 year ago
A) Configure a plugin for the method \Magento\Catalog\Model\ImageUploader: moveFileFromTmp() in di. xml
upvoted 0 times
...
...
Aimee
1 year ago
I disagree with Toshia. I believe option C) Create a custom Class implementing \Magento\Catalog\Model\ImageUploaderInterface and add it to the $uploaders argument of the UploaderPoolinterface via di.xml is the way to go.
upvoted 0 times
...
Toshia
1 year ago
I think option A) Configure a plugin for the method \Magento\Catalog\Model\ImageUploader: moveFileFromTmp() in di.xml is the best choice.
upvoted 0 times
...
Ernestine
1 year ago
I think option C is the way to go. Creating a custom class that implements the ImageUploaderInterface and adding it to the UploaderPool seems like the most flexible approach.
upvoted 0 times
Johnna
1 year ago
D) Configure a Virtual type based on \\Magento\\Catalog\\Model\\ImageUploader Specifying $baseTmpPath, $basePath and SallowedExtensions
upvoted 0 times
...
Ettie
1 year ago
C) Create a custom Class implementing \\Magento\\Catalog\\Model\\ImageUploaderInterface and add it to the $uploaders argument of the UploaderPoolinterface via di.xml
upvoted 0 times
...
Wynell
1 year ago
B) Create a custom implementation because the catalog imageUploader can not be used to for files associated with quote items
upvoted 0 times
...
Katy
1 year ago
A) Configure a plugin for the method \\Magento\\Catalog\\Model\\ImageUploader: moveFileFromTmp() in di. xml
upvoted 0 times
...
...

Save Cancel