direct file upload from end user's machine to sftp server
963119Sep 19 2012 — edited Sep 20 2012Hello there!
I want my application to provide an end-user with ability to upload the files from their machine to SFTP server directly. So far, I have managed to write the function which uses java source and allows to upload files from the database. It works just fine.
The function looks as follows:
FUNCTION SFTP_CMD (
V_USER IN VARCHAR2,
V_PASS IN VARCHAR2,
V_HOST IN VARCHAR2,
V_FILE_SRC IN VARCHAR2,
V_FILE_TRG IN VARCHAR2,
V_CMD IN VARCHAR2
)
RETURN VARCHAR2
IS
LANGUAGE JAVA NAME 'Sftp. sftpcmd( java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String ) return java.lang.String';
where V_FILE_SRC represents location of the file to be uploaded. The thing is that the FILE BROWSE apex item does not allow to specify the file location, it identifies it somehow automatically, when you press the button 'Choose file'. The question is how can I catch file's path, so that I can pass it to V_FILE_SRC parameter in my function? Should I write my own plugin? or hack FILE BROWSE item? =)