Re: Django storing byte string for image

2020-08-05 Thread Mottaz Hegaze
You can use database to store the location of the file on server , not the file itself.. Checkout in Documentation models.ImageField() models.FileField() On Tue, 4 Aug 2020, 9:01 pm را نيا, wrote: > Good evening > I want to import photos and PDF files from desktop app and display them in > web

Re: Django storing byte string for image

2020-08-05 Thread Andréas Kühne
Hi, You don't need to store them in the database - just store them in the file system instead? Regards, Andréas ‪Den tis 4 aug. 2020 kl 21:02 skrev ‫را نيا‬‎ :‬ > Good evening > I want to import photos and PDF files from desktop app and display them in > web app, how can I do it without using

Re: Django storing byte string for image

2020-08-04 Thread را نيا
Good evening I want to import photos and PDF files from desktop app and display them in web app, how can I do it without using binary format? Le jeudi 4 janvier 2018 10:44:53 UTC+1, Shem Ogumbe a écrit : > > Maybe try the conversion then save the path to MongoDb, but not the > bytsetring itself

Re: Django storing byte string for image

2018-01-04 Thread Shem Ogumbe
Maybe try the conversion then save the path to MongoDb, but not the bytsetring itself On Wednesday, January 3, 2018 at 3:03:36 PM UTC+3, chern...@gmail.com wrote: > > What field should i use to store byte string so that i can later use it > for ByteIO to convert it into image ? > > As this is my

Re: Django storing byte string for image

2018-01-04 Thread cherngyorng
> > From the requirement i get, i am suppose to store the bytestring into another > db. Main db is using postgresql, the image however is save to path into > mongodb. > > and yes, the image im recieving is in byte string. Thank you guys for your help ! I'm going to try it out locally first --

Re: Django storing byte string for image

2018-01-04 Thread Shem Geek
On Wednesday, January 3, 2018 at 3:03:36 PM UTC+3, chern...@gmail.com wrote: > > What field should i use to store byte string so that i can later use it > for ByteIO to convert it into image ? > > As this is my first time doing on byte string to image, i am pretty lost > on what i need to do. >

Re: Django storing byte string for image

2018-01-03 Thread James Schneider
On Jan 3, 2018 6:16 PM, wrote: As i am doing a django rest framework API for IOS mobile app currently, my >> partner told me that he will sent me a byte string for image. Then i have >> to convert the byte into image when a user request it. > > Storing the file in the DB (be it an image or ot

Re: Django storing byte string for image

2018-01-03 Thread cherngyorng
As i am doing a django rest framework API for IOS mobile app currently, my >> partner told me that he will sent me a byte string for image. Then i have >> to convert the byte into image when a user request it. > > > I don't mean to store it into database. Its just i do not know how to do >>

Re: Django storing byte string for image

2018-01-03 Thread Jason
For some additional reading on pros and cons of storing images in a database: https://www.quora.com/Is-it-a-bad-design-to-store-images-as-blobs-in-a-database https://dzone.com/articles/which-is-better-saving-files-in-database-or-in-fil https://dba.stackexchange.com/questions/736/is-it-better-to-s

Re: Django storing byte string for image

2018-01-03 Thread Avraham Serour
I used this project once: http://django-db-file-storage.readthedocs.io/en/latest/ It seems it uses a TextField for the file bytes. I would expect django.contrib.postgres to implement a binary field, but it don't. I guess you can implement your own field type for bytea, psycopg maps bytes to byte

Re: Django storing byte string for image

2018-01-03 Thread Jani Tiainen
Hi, In general it is considered very bad practice to store files in database. Could you please tell why you need to store files to database instead of normal filesystem? 3.1.2018 14.03 kirjoitti: > What field should i use to store byte string so that i can later use it > for ByteIO to convert

Django storing byte string for image

2018-01-03 Thread cherngyorng
What field should i use to store byte string so that i can later use it for ByteIO to convert it into image ? As this is my first time doing on byte string to image, i am pretty lost on what i need to do. I tried using BinaryField for the image model but when checking the field out on Django a