Sfoglia il codice sorgente

added get_file_url method

version-14
Rushabh Mehta 11 anni fa
parent
commit
71b097f756
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. +4
    -0
      webnotes/utils/file_manager.py

+ 4
- 0
webnotes/utils/file_manager.py Vedi File

@@ -10,6 +10,10 @@ from webnotes import conf

class MaxFileSizeReachedError(webnotes.ValidationError): pass

def get_file_url(file_data_name):
data = webnotes.conn.get_value("File Data", file_data_name, ["file_name", "file_url"], as_dict=True)
return data.file_name or data.file_url

def upload():
# get record details
dt = webnotes.form_dict.doctype


Caricamento…
Annulla
Salva