본문 바로가기

728x90
반응형

안녕하세요!

File Upload

[ Python ] Open WebUI 커스터마이징 - file upload(1) try_upload def try_upload(path, mime_type, upload_name): with open(path, "rb") as f: return requests.post( f"{WEBUI}/api/v1/files/", headers=HDR_FILE, files={"file": (upload_name, f, mime_type)}, timeout=60, ) path : 업로드할 로컬 파일의 절대 경로mime_type : 서버에 전달할 콘텐츠 타입upload_name : 서버/웹UI에 표시될 파일명 with open(path, "rb") as f - 바이너리 읽기 모드로 file .. 더보기
[ CAP ] CDS와 SAPUI5를 이용한 파일 업로드(1) - view / controller CDS와 SAPUI5를 이용한 파일 업로드(1) App.view.xml { this._uploadContent(item, id); }) .catch((err) => { console.log(err); }) } onAfterItemAdded 메서드는 파일 업로드 UI 컨트롤에서 새로운 파일 요소가 추가될 때 호출되는 이벤트 핸들러이다. _createEntity 메서드를 호출해 새로운 entity를 생성하고, 해당 entity ID를 가져온다. 그리고 _uploadContent 메서드를 호출하여 파일을 업로드 한다. 이 메서드에서는 Promise 객체를 사용해 비동기적으로 작업을 수행하게 된다. 즉 새로운 entity 생성 및 파일 업로드가 성공하면 _uploadContent 메서드가 호출되고, 실패하면 c.. 더보기
JSP_22-11-15 [ 파일 올리기 ] ○ Apache commons IO 2.11.0v https://mvnrepository.com/artifact/commons-io/commons-io commons-io commons-io 2.11.0 ○ Apache commons IO 1.4v https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload/1.4 commons-fileupload commons-fileupload 1.4 ○ imgscarl A Java scaling Library 4.2 https://mvnrepository.com/artifact/org.imgscalr/imgscalr-lib/4.2 org.imgscalr imgscalr-lib .. 더보기

loading