Comments (14)
UP :-)
from as_sftp.
Hi Seek,
Have you tried to debug the dbms_lob.getlength( l_file ) in the get_file function to check where the problem come from SFTP transfert or writing file in Oracle Dir ?
from as_sftp.
I can't reproduce this problem with the information you have supplied :)
from as_sftp.
Hi Seek, Have you tried to debug the dbms_lob.getlength( l_file ) in the get_file function to check where the problem come from SFTP transfert or writing file in Oracle Dir ?
Hi @mcmorgan, the OracleDir is ok, otherwise the file cannot be created.
I'll try to get the info you ask.
from as_sftp.
I can't reproduce this problem with the information you have supplied :)
:-D
Hi @antonscheffer, what kind of information do you need?
With the same SFTP user, using a client like Filezilla, I have no transfer problems.
The permissions on the Oracle directory are also appropriately set.
Is there a way to extrapolate useful information to trace the problem?
Sorry for the question but I'm not very experienced in SFTP communications.
Thanks
from as_sftp.
I think the issue is at line 3569, because the return of get_file is not tested. So even if the function return false, the file will be created
function get_file( i_path varchar2, i_directory varchar2, i_filename varchar2 )
return boolean
is
l_file blob;
l_rv boolean;
l_fh utl_file.file_type;
l_len pls_integer := 32767;
begin
l_rv := get_file( i_path, l_file ); -- l_rv IS NOT TESTED
l_fh := utl_file.fopen( i_directory, i_filename, 'wb' );
In my version of the function I added
l_rv := get_file( i_path, l_file );
IF NOT l_rv THEN RAISE_APPLICATION_ERROR(-20099, 'Erreur dans la récupération du fichier'); END IF;
from as_sftp.
Raising an error will not solve the issue (all files are downloaded with length zero).
Maybe comparing results from as_sftp.pwd and as_sftp.read_dir with the path parameter used for as_sftp.get_file might help.
Or see if something like this works
declare
l_file blob;
begin
.... open connection
as_sftp.put_file( i_path => 'small_file.txt', i_file => utl_raw.cast_to_raw( 'just a small test file for testing purposes.
It contains multiple lines.
This is the third.' ) );
as_sftp.get_file( 'small_file.txt', l_file );
dbms_output.put_line( dbms_lob.getlength( l_file ) );
.... close connection
end;
from as_sftp.
I meant that there should be an error in the logs (debug_msg) because the function get_file return FALSE for any error, then the file is created on oracle Directory with l_fh := utl_file.fopen( i_directory, i_filename, 'wb' );
So I think seek should put a g_log_level > 1 and check the logs, I think he should have a "get_file: not opened"
That's why I placed a l_rv test and a RAISE_APPLICATION_ERROR so I can be sure that any problem will stop my calling processes
function get_file( i_path varchar2, i_file in out nocopy blob )
..
if utl_raw.substr( l_buf, 1, 1 ) = SSH_FXP_STATUS
then
debug_msg( 'get_file: not opened' );
l_idx := 2;
get_int32( l_idx, l_buf, l_dummy ); -- id
get_int32( l_idx, l_buf, l_dummy ); -- reason code
get_string( l_idx, l_buf, l_buf2 );
debug_msg( utl_i18n.raw_to_char( l_buf2, 'AL32UTF8' ) );
exit;
from as_sftp.
With the default setting of log_level I think those debug_messages should be visible in the dbms_output.
(I need to change that sometime, those messages shouldn't be in the "default" setting. And log_level and the level info, error and debug uses is wrong too :) )
from as_sftp.
Hi Anton
I have same problem with get_file getting zero length.
Any update to resolve the issue?
Thanks
from as_sftp.
No, because I still don't know what the cause of the issue is.
It suspect that it might be a (Unix-) rights issue, the "Oracle" user can't read the files. But I'm not sure as I don't get any feedback on this.
from as_sftp.
It worked
I was passing only the folder excluding the file name for the i_path parameter
Thank you for your reply
Thanks
from as_sftp.
Hi,
I'm using the Inbound SFTP - where I'm trying to get a file from the client-server. I'm getting an error where I'm able to fetch the file but the content in the file is being replaced with the 'ls' command of that file. Not sure whether it is the 'ls' command or the hidden file content - (.) file - The content is - r . � .. qùsftp_out r!test1.txt .
Has anyone encountered this issue? If not - Please provide me the advice to resolve this issue.
Thanks in advance.
from as_sftp.
Hi,
I'm using the Inbound SFTP - where I'm trying to get a file from the client-server. I'm getting an error where I'm able to fetch the file but the content in the file is being replaced with the 'ls' command of that file. Not sure whether it is the 'ls' command or the hidden file content - (.) file - The content is - r . � .. qùsftp_out r!test1.txt .
Has anyone encountered this issue? If not - Please provide me the advice to resolve this issue.
Thanks in advance.
I've got the solution - I just need to change the i_directory path to amend file_name to it - It worked!
from as_sftp.
Related Issues (20)
- MKDIR (create a directory) implementation HOT 1
- Login using a RSA key HOT 4
- support for ed25519 HOT 2
- First attempt to open connection failed HOT 5
- Login with RSA Key and Passphrase HOT 1
- Key management HOT 1
- rsa-sha2-256 for login HOT 1
- ORA-29276: transfer timeout faced while using as_sftp.put_file HOT 1
- Problem with open_connection HOT 1
- Does the package support RSA key login? HOT 2
- TLS_AES_256_GCM_SHA384 HOT 1
- New Ciphers? HOT 1
- Support for read_dir function HOT 2
- Type conversion in login_pk function HOT 1
- Read_dir in recursive mode HOT 1
- Uploading the file partially HOT 2
- Oracle Autonomous Transaction Processing (ATP) and Compute Instance sftp HOT 4
- Issue with DSA public key HOT 9
- Incorrect signature verification for ssh-dss HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from as_sftp.