Private file not accessible

Hi, I am an administrator and not able to access Private files, getting blank page while opening the private files. but when i check public it is accessible,
please help me for making access to private files to all system users.

or help me with this instead that how to set this check box marked as default? like when i upload user image it is marked as default.

Capture

Capture1

You can go to the file and uncheck Is private. This will make the file public.

If you want to edit in bulk, you can do a data import for type file and edit the Is Private column and change the values to 0 for files you want to make public.

Foe more help on data import tool: https://erpnext.org/docs/user/manual/en/setting-up/data/data-import-tool

PS: if the file is private, it should be accessed by the user when he is logged in to desk. If you can paste a screenshot of the error message it would be helpful.

@kennethsequeira thanks for your reply buddy but i don’t want to import any thing,
i am just viewing it as a normal user,
User will upload attachments and they have check Public checkbox every time.
This is not good. sometimes user will do mistake and forget to check the Public box. then attach files is not accessible to anybody even including Administrator.
Because i think my ERPNEXT has a bug, private files not accessible in my server,
whenever i open private files it loads a blank page,
Help me for private files to be visible. or alternate way is Public checkbox is checked by default.
hope you’ve understood.

Paste a screenshot of what happens when you’re trying to access private files.

It is not a bug unltil validated by others as well.

@kennethsequeira here are the screenshots,
whenever i try to upload file as a private in any doctype’s document it will not accessible, it opens a blank page.

1

My friend, there seems no bug. it may be different way to look at the comfort level. If user forgets to click on ‘public box’, system will take it as ‘private’. I’m sure we all being taught about computers work on GIGO principle. So, in this case user needs to be trained, rather than changing the system.

1 Like

@FinForce Friend don’t mind but its better to change the system instead of changing the hundreds of peoples mind,
If user make a mistake its not their mistake, its developer mistake.
I am just wonder that how my ERPNEXT attachments are not working like normal ERPNEXT?

1 Like

I agreed partly with you. So, maybe what you suggesting to make ‘public’ as a default parameter and if the user specifically wants it to make it ‘private’, he does an action - I guess thats fair point, and it should be doable. @kennethsequeira, what you say?

Yes please, i want Public check box to be checked by default.

2

You can create a new Github issue for this request.

@FinForce there is a specific reason to keep it private. If a file is public, it can be accessed by the URL by users who are not logged into the system. So making the files private by default is very risky.

If a file is private, to non-users it shows a 403 error straight away. Changing user behaviour, in this case, would be better.

1 Like

@kennethsequeira i think my GitHub Issue will not be entertained because i am the only who is facing this problem,
I know this is very risky but i have to manage it.

Why do you presume the outcome, even before raising a GitHub issue. You please do your part of the action and let others in the community contribute, comments on it.

1 Like

I asked to create a Github issue for the suggestion of checking Public for file uploads.

Your current issue seems to be arising due to some other problem. If the file was accessible to you, there should have been a 403 warning instead.

@FinForce & @kennethsequeira thanks for help buddies.
i’ve opened a issue on GitHub.

https://github.com/frappe/erpnext/issues/14542

i was facing the same issue,
then i tried manual installation instead of builtin Bitnami Application to resolved this issue.

but i have alot of data and customization in my current server i cannot move it.
i also tired manual installation when we started, but no luck.

hi
same is happening me too here. got this server error after unchecked the private button.

Traceback (most recent call last):
File “/home/next/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 259, in save
return self._save(*args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 295, in save
self.run_before_save_methods()
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 885, in run_before_save_methods
self.run_method(“validate”)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 780, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 774, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 98, in validate
self.validate_file()
File “/home/next/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 179, in validate_file
frappe.throw(
(“File {0} does not exist”).format(self.file_url), IOError)
File “/home/next/frappe-bench/apps/frappe/frappe/init.py”, line 339, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/next/frappe-bench/apps/frappe/frappe/init.py”, line 325, in msgprint
_raise_exception()
File “/home/next/frappe-bench/apps/frappe/frappe/init.py”, line 298, in _raise_exception
raise raise_exception(msg)
IOError: File /private/files/Supplier.xlsx does not exist

Traceback (most recent call last):
File “/home/next/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = frappe.handler.handle()
File “/home/next/frappe-bench/apps/frappe/frappe/handler.py”, line 20, in handle
data = execute_cmd(cmd)
File “/home/next/frappe-bench/apps/frappe/frappe/handler.py”, line 55, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/next/frappe-bench/apps/frappe/frappe/init.py”, line 1007, in call
return fn(*args, **newargs)
File “/home/next/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 259, in save
return self._save(*args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 295, in save
self.run_before_save_methods()
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 885, in run_before_save_methods
self.run_method(“validate”)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 780, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/next/frappe-bench/apps/frappe/frappe/model/document.py”, line 774, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/next/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 98, in validate
self.validate_file()
File “/home/next/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 179, in validate_file
frappe.throw(
(“File {0} does not exist”).format(self.file_url), IOError)
File “/home/next/frappe-bench/apps/frappe/frappe/init.py”, line 339, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/next/frappe-bench/apps/frappe/frappe/init.py”, line 325, in msgprint
_raise_exception()
File “/home/next/frappe-bench/apps/frappe/frappe/init.py”, line 298, in _raise_exception
raise raise_exception(msg)
IOError: File /private/files/Supplier.xlsx does not exist

Hi
after making the file as public still unable to access

self.fp = open(file, modeDict[mode])
IOError: [Errno 2] No such file or directory: u’./dev.local/files/test1.zip’

I am getting this error when uploading zip file as a public. file has been uploaded but it gives error on updating. i don’t want show this error message. please help.

I am also facing the same issue. When user mark it as private, it is not accessible to anyone including Admin. Even after marking the file as public from “File” section, it is not accessible.