w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
C# SharpSSH changing SFTP port.
SshTransferProtocolBase has a connect method with 1 overloads. The defalut one takes no argument and defaults to port 22. The overload takes a port number. So: SshTransferProtocolBase ftp = new SshTransferProtocolBase("host","user"); ftp.connect(5929); The above should work.

Categories : C#

Uploading file with sFTP usnig asp.Net throws Tamir.SharpSsh.jsch.SftpException
//Esto funcionara al momento de hacer el Get tenemos que especificar el //directorio principal del FTP+nombre del archivo private static bool descargar_archivos() { Sftp _sftp = new Sftp(Servidor_FTP, Usuario_FTP, Contrasena_FTP); _sftp.Connect(Puerto); var lista = _sftp.GetFileList(Directorio_inicio_FTP); foreach (string dir in lista) { if (dir.Length > 4) { _sftp.Get(Directorio_inicio_FTP+dir, Directorio_Destino + dir); } } _sftp.Close(); return true; }

Categories : C#

Connecting to AS400 server from java code through SFTP
The IBM i (AS/400) does not have an SSH daemon installed by default. The Midrange Wiki has some information about Setting up an iSeries SSHD server. The JTOpen/IBM Toolbox for Java library may be a better solution for interfacing with the system. There are Access classes that support file transfer.

Categories : Java

SFTP: how to know if i'm connecting to a unix or windows host?
There is a number of possible ways to complete your task, however I'm not sure if your libraries support them: SFTP protocol contains SSH_FXF_TEXT_MODE file open flag, allowing to open file in text mode, translating EOL sequences to CRLF (available since version 6 of protocol, AFAIR). 'newline' SFTP extension - it tells exact server's EOL convention Parsing SSH server software/version string.

Categories : Java

SFTP a file created on SQL Server with a Stored Procedure to a UNIX Server
i was facing a similar problem and i solved it using SSIS and a free tool called WINSCP. First you shuold know that: By default, SQL Server Integration Services (SSIS) do not support access to SFTP sites. One way of getting it done is by using third party software, There's a free tool called WinSCP which provides a command line utility to communicate with SFTP sites. It has to be scripted from the command line and then executed from SSIS. then... The first step is to download and install WinSCP, you will need to do this on the SQL server that will be running the SSIS package. Once you have installed WinSCP you should create a connection to the distant sFTP server in WinSCP so you can test and confirm that you can connect to it. Create and name a saved session

Categories : Unix

SFTP remove files with wildcard characters
Does the phpseclib delete function supports wildcard character ? If not, any alternatives ? Not at present no. I guess you could do $sftp->nlist() and do a preg_match on each row returned by nlist. If it matches delete it, otherwise keep it.

Categories : PHP

Transferring & Deleting Files From SFTP Using SFTP Foreign Module
You need to get a good Perl book which will help you learn how to code Perl in a more modern style. I recommend Learning Perl. This should teach you some techniques in coding. For example, always use use strict; and use warnings;. These two modules will catch about 99% of all coding errors. Also, the standard way of doing an error check is to use the or die style syntax. This is a much more natural method than setting a variable, and then checking the variable, and if there is an error, then going to a subroutine: $stfp->ls or die qq(Cannot access remote machine ) . HOST; It would also be nice if you indented too. Makes following your code easier. Perl has a standard that variables should be all lowercase, and the newest standard is to use underscores to help separate out variable

Categories : Perl

sftp server implementaion with Python
The following code snippet demonstrates simple implementation of sftp client with paramiko >>> import paramiko >>> pkey = paramiko.RSAKey.from_private_key_file('rsa.key') >>> transport = paramiko.Transport(('localhost', 3373)) >>> transport.connect(username='username', password='password', pkey=pkey) >>> sftp = paramiko.SFTPClient.from_transport(transport) >>> sftp.listdir('.') ['File.txt', 'File2.txt'] Very simple SFTP server in python: sftpserver 0.2

Categories : Python

PHP download from remote server via sftp
Update: I was kindly corrected that this doesn't use sftp, but instead uses ftps. Here's a Stackoverflow link discussing using PHP to do SFTP. The PHP docs already cover most of what you should need for this. Here's an example for fetching a list of the contents in the remote directory: <?php // set up basic connection $ftp_server = "example.com"; $conn_id = ftp_ssl_connect($ftp_server); // login with username and password $ftp_user_name = "myuser"; $ftp_user_pass = "mypass"; $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); ftp_pasv($conn_id, true); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo

Categories : PHP

How to upload file with curl on sftp server
Maybe this link can help you, There are some examples of different ways to upload files using CURL. or try this $ch = curl_init(); $localfile = ‘sample.txt’; $fp = fopen($localfile, ‘r’); curl_setopt($ch, CURLOPT_URL, ‘sftp://user:pass@ftp.remote.com/’.$localfile); curl_setopt($ch, CURLOPT_UPLOAD, 1); curl_setopt($ch, CURLOPT_PROTOCOLS, CURLPROTO_SFTP); curl_setopt($ch, CURLOPT_INFILE, $fp); curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile)); curl_exec ($ch); $error_no = curl_errno($ch); curl_close ($ch); if ($error_no == 0) { $error = ‘File uploaded succesfully.’; } else { $error = ‘File upload error.’; }

Categories : PHP

Checking if file exists in a SFTP server with java
This is is you're using the sftp part of the library, an assumption I made without thinking about it. I thought its ls(String path) would accept filenames; I can't check at the moment. If it doesn't, you don't need to iterate manually; you can use the selector variant: ls(String path, ChannelSftp.LsEntrySelector selector)

Categories : Java

Importing database from an sFTP server in Windows Azure
This depends on whether you are trying to use Azure PaaS (cloud service and SQL Azure) or IaaS (VMs). If you are using VMs on Windows Azure, there is going to be no difference between Windows Azure and your familiar Windows environment - so yes, you can do this on Windows Azure. This can't really be done in Azure cloud services and SQL Azure (SQL Azure cannot restore a .bak file). But your application doesn't seem to be the kind that would run as a cloud service anyway. Stick to doing it on VMs and it will work as you are familiar with.

Categories : SQL

SFTP server set user/password in Apache Mina SSHD
Change new UserAuthNone.Factory() to new UserAuthPassword.Factory() and then implement and register PasswordAuthenticator object. Its authenticate method should return true for valid username and password parameters. List<NamedFactory<UserAuth>> userAuthFactories = new ArrayList<NamedFactory<UserAuth>>(); userAuthFactories.add(new UserAuthPassword.Factory()); sshd.setUserAuthFactories(userAuthFactories); sshd.setPasswordAuthenticator(new PasswordAuthenticator() { public boolean authenticate(String username, String password, ServerSession session) { return "tomek".equals(username) && "123".equals(password); } });

Categories : Java

SharpSSH - Get partial contents of file?
SFTP is not FTP and has very little in common with FTP. However, you can use SFTP to access parts of the file. This requires use of low-level methods offered by SFTP, such as OpenFile, ReadFile and CloseHandle (those methods are very similar to usual filesystem operations but they are executed by the SFTP server). I doubt that SharpSSH or anything similar offers such method. Our SecureBlackbox does, though, so you can use it for your task.

Categories : C#

sqlsrv error while connecting to mssql server 2008 on windows 2003 server
Two ways to try, first to check if the Native driver has the right version - is your server really a 32bit Version and not 84bit? The other thing is, to check if the extensions are actually loaded. To check that, create a file like "phpinfo.php" and put it in you folder for .htdocs. <?php // show phpinfo file phpinfo(); ?> The easy way is to search for it in the phpinfo-Page with Ctrl+F and "extension=php_sqlsrv_53_ts_vc9.dll"

Categories : PHP

Batch File Connecting to Server and execute program install on connected server
Here's a little code to help you connect to the SQL server and interrogate the SQL version. @ECHO OFF SQLCMD /? > nul 2> nul IF ERRORLEVEL 1 ECHO.SQLCMD not found on this machine & PAUSE & GOTO :eof SET SQLCmdLine=SQLCMD -b -w400 REM use something like the next line for NT authentication; second line for SQL authentication REM for NT SET SQLCmdLine=%SQLCmdLine% -E -S "YourServerName" REM for SA SET SQLCmdLine=%SQLCmdLine% -U "YourSQLUserName" -P "YourSQLPassword" -S "YourServerName" SET Database=YourDatabaseName REM I will use NT Authentication for this example SET SQLCmdLine=%SQLCmdLine% -E -S "(local)" SET TestSQLCmdLine=%SQLCmdLine% -h-1 -d "%Database%" REM this will get the SQL version %TestSQLCmdLine% -Q "SELECT @@VERSION" | FINDSTR /v "rows affected" REM this will

Categories : SQL

check the manual that corresponds to your MySQL server version for the right syntax
check the sql Fiddle Link http://sqlfiddle.com/#!2/0060c $tname=addslashes($_POST["appname"]); $creatt="CREATE TABLE `$tname` ( AppVersion VARCHAR(30), AppType VARCHAR(30), FileName VARCHAR(255), AppSize FLOAT, sizetype VARCHAR(30), apppart FLOAT, appLRadress VARCHAR(255), appSRadress VARCHAR(255), appRadress VARCHAR(255), apptahye DATE, appupload DATE, appfenally DATE, status CHAR(30), applearn CHAR(30), applearnadd VARCHAR(255), applearnudate DATE, learntype VARCHAR(30), appcrack CHAR(30), appcrackadd VARCHAR(255), appcrackdate DATE, cracktype CHAR(30) );

Categories : Mysql

Remove connecting lines in ggplot2 geom_polygon
If you need to plot just borders then you can use geom_path() and column group for group=. You also have to add coord_map() in this case to maintain right aspect ratio between x and y axis. ggplot(ukMapFortSub,aes(long, lat, group=group))+ geom_path(color="black")+coord_map()

Categories : R

42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
Use query parameters in the cursor.execute() call of your process_query function. This will handle any escaping issues (protecting your code against SQL injection) and promotes statement preparation. Change the process_query function to accept two parameters, one for the SQL string (containing parameter value placeholder) and one for parameter values: def process_query(sql, params): cursor1.execute(sql, params) The for loop would then change to: for i in theList: temp=process_query('SELECT FName, LName FROM Employee WHERE SSN=?', i) known_hours=process_query('SELECT DISTINCT SUM(Coalesce(Hours,0)) FROM Works_On WHERE ESSN=?', i) temp.append(known_hours) unknown_hours=process_query('SELECT Distinct COUNT(*) FROM Works_On WHERE ISNULL(Hours) AND ESSN=?', i) temp.

Categories : Python

Kepp getting "check the manual that corresponds to your MySQL server version for the right syntax to use near ' '')' at line 1
What is the type of Year column? Is it integer? If not then put the value in single quote like this '{$year}' . As suggested by @minitech escape user data before storing in database using mysql_real_escape_string

Categories : PHP

What is the command to get the .listing file from SFTP server using cURL command
This is what I found on http://curl.haxx.se/docs/faq.html#How_do_I_get_an_FTP_directory_li If you end the FTP URL you request with a slash, libcurl will provide you with a directory listing of that given directory. You can also set CURLOPT_CUSTOMREQUEST to alter what exact listing command libcurl would use to list the files. The follow-up question that tend to follow the previous one, is how a program is supposed to parse the directory listing. How does it know what's a file and what's a dir and what's a symlink etc. The harsh reality is that FTP provides no such fine and easy-to-parse output. The output format FTP servers respond to LIST commands are entirely at the server's own liking and the NLST output doesn't reveal any types and in many cases don't even include all the directory en

Categories : Linux

Manual import into SQL Server 2000 of tab delimited text file does not format international characters
I would try using the bcputility ( http://technet.microsoft.com/en-us/library/ms162802(v=sql.90).aspx ) with the -w parameter. You may also want to check the text encoding of the input file.

Categories : Sql Server

Query Failed!You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
ORDER is a reserved keyword. So, you'll need to escape it in backticks, like so: INSERT INTO `order` ... Not using reserved keywords in your query would be the better solution, but escaping them with backticks works, too.

Categories : PHP

Connecting to a SQL Server DB
Well this seems to work ok, use DBI; # $dbh = DBI->connect( "dbi:mysql:DBNAME", "root", "password" ) or die "Connection Error $DBI::errstr "; N.B. Please Check you have the required modules installed.

Categories : Perl

Connecting Sql Server though Node.js
I just did it following this walkthrough at http://tech.pro/tutorial/1848/getting-nodejs--sql-server--azure-to-work-together He's using the "msnodesql" package at https://www.npmjs.org/package/msnodesql, code at git-hub at https://github.com/WindowsAzure/node-sqlserver, and I've got it running in a node-console app with a simple select-statement: var mssql = require('msnodesql'); var conn_str = "Driver={SQL Server Native Client 10.0};Server=tcp:xxxxx;Database=yyyy;Uid=zzzz;Pwd=wwww;Connection Timeout=30;"; mssql.query(conn_str, "select * from testtable", function(err, recordset) { if(err){ console.log("Got error :-( " + err); return; } recordset.forEach(function(record) { console.log("name: " + record.Name + " (" + record.ID + ")"); }); });

Categories : Sql Server

Connecting to wamp server from different pc
you need to follow the below steps: 1.in httpd.conf DocumentRoot "C:/xampp/htdocs" //add your wwwroot folder path (this is Xampp example) <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> 2.Open httpd-vhost.conf and add: ##</VirtualHost> <VirtualHost Name:80> DocumentRoot C:/xampp/htdocs/wwwroot/ <Directory "C:/xampp/htdocs/wwwroot/"> Options Indexes FollowSymLinks Includes execCGI AllowOverride All Order Allow,Deny Allow From All </Directory> ServerAdmin (any@email.com) ServerName (IP address or FQDN) </VirtualHost> 3.The most Important step is to add an exception for the used port(80 in this example) on windows firewall. Hope this helps :)

Categories : PHP

Connecting to database server using php
This should be basically the mysqli version of what you wrote. <?php $username = "user"; $password = "pass"; $hostname = "creative.coventry.ac.uk"; $mysqli = new mysqli($hostname, $username, $password, "asantec"); $stmt = $mysqli->prepare("SELECT * FROM books;"); $stmt->execute(); $stmt->bind_result($id, $title, $author, $price); //Put all your expected variables here while ($stmt->fetch()) { echo $id.'<br />'; echo $title.'<br />'; echo $author.'<br />'; echo $price.'<br /><br />'; } $mysqli->close(); ?> Also, if you have any issues in the code you've posted, this will work. Check your DB credentials and the data you're querying.

Categories : PHP

Connecting to SQL Server in Xcode
One route to take is to make a copy of that Database and put it on the phone as an SQLite Database and have a PHP script that gets the newest additions and adds them to the SQLite database. A second route you could take, is you could ask him to put it JSON format and you would have a dictionary on the phone that held all of the JSON, and then parse the JSON using apples built in parser, NSJSONSerialization or any of the other JSON parsers out there. Using the parsed JSON, you could then do as you please with the list of notifications Another method will be for that guy to write a PHP script for you to access all the notifications and you run that in a for loop and populate a table, or whatever, on the phone of the latest push notifications that way. This while take a few seconds longer t

Categories : Iphone

connecting to an SQL Server database
The problem your having with regards to connecting to the database on a server is because of SqlConnection dbConnection = new SqlConnection("Data Source=.\SQLEXPRESS;Integrated Security=true"); The best way to do this is to go to your Web.config file and find the block and add a connection to your database in there. eg <add name="ConnectionString" connectionString="Data Source=YOUR SERVER;Initial Catalog=YOUR DATABASE;User ID=YOUR USER ID;Password=YOUR PASSWORD" /> then you can just call the connection string accross your whole project whenever you need to use it. Also with regards to VS2012. There are very few companies using that IDE at the moment so your probably better off learning VS 2010 in the most part but i would agree that VS2008 is fairly out of date now

Categories : C#

Client isn't connecting to server
Always create output output stream before your input stream for Object streams, otherwise you create a deadlock situation. output = new ObjectOutputStream(socket.getOutputStream()); // output.flush(); if the underlying stream is buffered input = new ObjectInputStream(socket.getInputStream()); The input reads the header written by the output, which won't be there unless the output is created first.

Categories : Java

issues in connecting to AD server over SSL?
If you can't get TLS to work, it is unlikely that SSL will work. Are you sure that you got the right certificate and configured the keystore correctly? Based on the SSLHandshakeException when trying to use TLS, it would seem that may not be set up correctly. Check out this SO answer for some tips on how to verify that your keystore is correctly set up: http://stackoverflow.com/a/9619478/1792088

Categories : Java

Connecting to sql server 2008 using vb
In DBConnect, check the status of objConn to make sure it's really being opened. In DBConnect, you have exit function before response.write. In GetValue, check value of err.number.

Categories : Vb.Net

Connecting Android and java EE server
You can use JAX-RS to build a RESTful Webservice, and you can use JSON as the payload. Jersey is a reference implementation, and is a good one. There is JSON support as well.

Categories : Java

Connecting to SQL Server on a different port in SSRS
Syntax is the same as you would enter in SSMS. See below screenshot taken from the Data Source properties window:

Categories : Sql Server

Connecting C socket server from PHP using PHP Extension
Debug your code properly, could you receive parameters in your C Client code passed from PHP function call, I hope you will not get the parameters which you are passed from PHP function call. Check your parameters receive section, there you have to check the type of values sending from PHP should match the type of declaration in your C Client socket connection scripts. I hope replace your receive parameters section with my following code, it will work. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls|b", &i_iPortNumber, &i_pcIPAddress, &return_long) == FAILURE) { RETURN_NULL(); }

Categories : PHP

Connecting to remote server with pgadmin
Specify a different local port in the script. The specified port is already in use by something else, possibly a local PostgreSQL running on port 5433. That's really just a toy wrapper around an SSH tunnel. Personally I tend to just fire up the ssh tunnel directly when I need that, or ssh into the remote machine and use psql on it locally.

Categories : Postgresql

Connecting to my company mail server
You could you outlook.com's web based interface to connect to POP3 accounts, similar to what you do in outlook express. Similarly you could add your email as additional account in gmail too.

Categories : Email

Error connecting to server in a file
This line: inet_aton(h->h_addr_list[0],&indirizzo_server); is wrong. h_addr_list is not a list of strings in the format that inet_aton expects. It's not even a list of strings at all. It's a list of addresses ready to be copied directly into the appropriate field of the struct sockaddr_*. The char **h_addr_list in struct hostent should be treated as void **, which is what it would be if it hadn't been designed before ANSI C gave us void. A generic pointer is used because gethostby* supports (at least theoretically) arbitrary address families. In the case of h_addrtype==AF_INET, each h_addr_list[n] is a pointer to a struct in_addr, so you can just say indirizzo_server = *(struct in_addr *)h_addr_list[0]; and all will be well.

Categories : C

Connecting to a TCP server via TcpClient through proxy
In this link you would get code to connect tcp via http proxy.

Categories : C#

Not seeing database from localhost but seeing it when connecting to server
GRANT USAGE is not what you want. According to the mysql documentation: USAGE Synonym for “no privileges” It is used at the global level with GRANT to modify account attributes such as resource limits or SSL characteristics without affecting existing account privileges. http://dev.mysql.com/doc/refman/5.1/en/grant.html You need to grant actual privileges to your "someuser" user for the database the user needs to see. For example, if you grant select privileges on the mysql.*: GRANT SELECT ON mysql.* TO someuser@localhost IDENTIFIED BY "somepassword"; FLUSH PRIVILEGES; Now, someuser connected from localhost will be able to see the mysql database when executing SHOW DATABASES; However, you might want to reserve the access to the mysql database for root only.

Categories : Mysql



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.