0
파일이 파일 시스템 루트 디렉토리에있을 때 파일을 병에서 다운로드 할 수있게 만드는 방법. 예를 들어, 우분투 운영 체제의 '미디어'디렉토리 안에 있습니까?병이있는 작업/프로젝트 디렉토리 외부에서 파일을 다운로드 할 수있게하십시오.
파이썬 :
이#bottle 0.12.10
@route('/download/<filename:path>')
def staticdownloadfile(filename):
return bottle.static_file(filename, root='/media', download=filename)
HTML :
이<a href="/static/media/somefile.extension">download here</a>
위의 방법이 작동하지 않는 이유는 무엇입니까? 404 찾을 수 없음. 다른 링크를 사용해야 HTML 파일에서