Re: Error loading static file from a NAS (CIFS mounted) Not 404...

2023-02-27 Thread Hua Liang

Okay I think I know the problem.

Apache2 has a bug with CIFS, set EnableMMAP Off in config will solve this.
On Monday, February 27, 2023 at 6:29:12 AM UTC-8 Hua Liang wrote:

> Hello,
>
> I have a django site and I have two storages serving static files.
> One is a hard drive attached to the server and the other is a NAS share.
>
> Both are mounted and I can view the files in Ubuntu without any problems.
>
> Both are linked to Django static folder.
>
> The problem is that when I tried to access the file from Django web, the 
> NAS one always fails with corrupted file.
> e.g. I have an image file image.jpg in both local drive and NAS share
>
> lets say "static/media1" is linked to the local drive, and "static/media2" 
> is linked to the nas share
> if I visit
> http://django-site-ip/static/media1/image.jpg, it is fine.
> if I visit
> http://django-site-ip/static/media2/image.jpg, it is corrupted. (but I 
> can view it in ubuntu)
>
> I downloaded the image from the site and I found that the size is 
> different compared to the original file.
>
> Anyone knows what the issue is?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/621024f7-3a1a-4640-a9cb-5f1baf4d99ebn%40googlegroups.com.


Error loading static file from a NAS (CIFS mounted) Not 404...

2023-02-27 Thread Hua Liang
Hello,

I have a django site and I have two storages serving static files.
One is a hard drive attached to the server and the other is a NAS share.

Both are mounted and I can view the files in Ubuntu without any problems.

Both are linked to Django static folder.

The problem is that when I tried to access the file from Django web, the 
NAS one always fails with corrupted file.
e.g. I have an image file image.jpg in both local drive and NAS share

lets say "static/media1" is linked to the local drive, and "static/media2" 
is linked to the nas share
if I visit
http://django-site-ip/static/media1/image.jpg, it is fine.
if I visit
http://django-site-ip/static/media2/image.jpg, it is corrupted. (but I can 
view it in ubuntu)

I downloaded the image from the site and I found that the size is different 
compared to the original file.

Anyone knows what the issue is?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dd60520c-619a-4492-998f-b90dba1dd170n%40googlegroups.com.