You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to be able to add a part image and/or part attachment directly from an URL. Right now you have to download the image/document locally and then upload via GUI.
This together with #623 would make for a great usability improvement.
Reacted by Francois, Konstantin Fedorov and Oliver
This would make a 2-step process (download the file locally, then uploading it via the existent functionality) into 1-step fast process. I guess the only "drawback" on this method is that the Inventree server requires internet access (don't know if right now it really needs it for something).
@SchrodingersGat Agree but I think it comes down to the same level of trust for user to download the image on their local machine then upload it to InvenTree. Whatever is embedded in the "image" file will persist. This would just cut the middle man (eg. local machine). What do you think?
Activity
SchrodingersGat commentedon Feb 17, 2021
Agreed it would be a great productivity increase. I am just unsure on exactly how to best implement it:
eeintech commentedon Feb 17, 2021
I think a simple wget (or any other web scrapping Python library) should work to grab the image from the URL and set it as main picture?
SchrodingersGat commentedon Feb 17, 2021
Getting the image from the web is pretty straight-forward, but how to tell the server which image to download?
A) Copy and paste the URL?
B) Drag and drop the image from the browser? (Preferred)
if B) then I am not yet aware of a good way to extract the URL from a drag-and-dropped image
ivladz commentedon Feb 17, 2021
I was thinking of method A, have a URL box in the Image upload form:

Where you would paste an image link from the web (for example https://inventree.readthedocs.io/en/latest/assets/images/api/api_doc.png).
This would make a 2-step process (download the file locally, then uploading it via the existent functionality) into 1-step fast process. I guess the only "drawback" on this method is that the Inventree server requires internet access (don't know if right now it really needs it for something).
eeintech commentedon Feb 17, 2021
I was also thinking A) because it's easy enough to right-click on the image and directly get the URL.
A check for internet access would be needed indeed.
SchrodingersGat commentedon Feb 17, 2021
It should not be too hard to implement it this way. However there is a level of "user trust" here, exposing the server directly to the internet!
eeintech commentedon Mar 10, 2021
@SchrodingersGat Agree but I think it comes down to the same level of trust for user to download the image on their local machine then upload it to InvenTree. Whatever is embedded in the "image" file will persist. This would just cut the middle man (eg. local machine). What do you think?
SchrodingersGat commentedon Mar 15, 2021
Sure, it's the same on the "client side" of user trust.
I guess that on the server side, we could ensure that the code to actually download the image performs a bunch of checks:
eeintech commentedon Mar 16, 2021
This sounds like a fun little project 😄
SchrodingersGat commentedon Mar 16, 2021
Work in progress here - #1410