w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

Copy file from internal server to remote server in IIS 7
try convert virtualpath to phyicalpath in a handler, such as system.web.httpserverUtil.mappath http://asp.net.bigresource.com/Uploading-files-to-server-and-saving-outside-virtual-path-bMVjFTYf4.html#l9LpkWyji http://forums.iis.net/t/1157234.aspx

Categories : C#

How to create Folder in Remote Location
It should work on your server also, as long as you have permissions to create a folder in the specified directory. Why don't you try it and see? If you get an error, make sure to post the full error message.

Categories : C#

How do you dynamically path to a remote server folder in C#?
Try something like this: file:///c:/path/to/the%20file.txt If you have to... opening local files in the browser is not a widely used technique. It will only work on your computer so to speak. There is no way this logic will work if the browser is not running on the same machine as the website. You should consider a solution where the server sends the file's content to the browser in a byte[]. There is an example of that here.

Categories : C#

Creation of folder on FTP fails when running on remote server
A few questions: Is the host (xxxxx in your example) passed to the Create method a reachable domain from your machine/network ? What is the resp.StatusCode when you debug ? Are any exceptions thrown ? A similar issue: http://stackoverflow.com/a/3789350/956364 Other than that, your code looks identical to the version by Jon Skeet: How do I create a directory on ftp server using C#?

Categories : C#

Copy data from local production SQL Server database to remote read only SQL Server database
I think the logshipping solution fits your needs. After a one-time setup proces, the logs would be continually shipped from the local db to the remote db. Keeping the remote perfectly in sync with the local one, providing you with the readonly copy. Logshipping is available in all editions, besides Express. There would be no need for a continuous restore process. You can find more information here.

Categories : Sql Server

How to copy files in an svn repo to another folder on the server
Use the svn export command to do that. The subversion red book explains in detail how to do that. When the relevant svn repo is stored under /export/svn/repo, and the part of the repository you want to copy from is /trunk/my_project/news, the whole command will be: svn export file:///export/svn/repo/trunk/my_project/news /var/www/news

Categories : Linux

Ho can I copy files from mutible pcs to network share and create a folder?
$branch = 1 Get-Content list.txt | ForEach-Object { if(Test-Connection $_ -Quiet -Count 1){ $branch2 = $branch.ToString() $folder = $_ + $branch2 Copy-Item "\$_c$windows*.ini" "\Networkshare$folder" } $branch = $branch + 1 } The way I understand your question, that should solve your problem. EDIT: Look at this: PS C:> $v1 = "hello" PS C:> $v2 = "world" PS C:> $v3 = $v1 + $v2 PS C:> echo $v3 hello world EDIT 2: Look at the String conversion

Categories : Powershell

php sftp file or folder
I would strongly suggest using phpseclib for SSH2 purposes. It greatly simplifies tasks like this. Solution for your problem using phpseclib should go something like this: include('Net/SFTP.php'); $sftp = new Net_SFTP($_SESSION['Server'] . ':' . $_SESSION['Port']); if (!$sftp->login($_SESSION['Username'], $_SESSION['Password'])) { exit('Login Failed'); } foreach($sftp->rawlist($dir) as $filename => $attrs) { if ($attr['type'] == NET_SFTP_TYPE_REGULAR) { echo $filename . ' is a regular file!'; } if ($attr['type'] == NET_SFTP_TYPE_DIRECTORY) { echo $filename . ' is a directory!'; } } These are the file type constants phpseclib uses: file_types = array( 1 => 'NET_SFTP_TYPE_REGULAR', 2 => 'NET_SFTP_TYPE_DIRECTORY', 3 => '

Categories : PHP

eclipse remote project with sftp - dltk indexing results in 'no more sessions' error
I was able to fix this issue by doing two things: set up ssh to use multiplexing (see http://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing) in the virtual machine Upgrade eclipse to Kepler 64Bit release (much faster and more stable in Windows 7) with manual installation of PDT feature (using Zend PDT is a waste of time) This also works with Java7! Now I have completely indexed projects and can use code-completion!

Categories : Eclipse

Using the Git folder as my main folder, or as a copy of the actual work folder?
Don't copy ! There's no point in doing it and it's prone to accident as you noticed. Simply do your git operations in your work repository, and use push/fetch operations to propagate to other repositories.

Categories : GIT

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

How to create a partition in remote ApacheDS, LDAP server
Please refer to http://directory.apache.org/apacheds/basic-ug/1.4.1-changing-server-port.html link to create partition on remote server. I am using ApacheDS Version: 2.0.0-M14 and Apache Directory Studio Version: 2.0.0.v20130628. Hope this will help you. Thanks Shirish

Categories : Windows

asp.net create folder and file in other server
Though I don't know whether or not you're getting an exception at the moment, this is almost assuredly a permissions issue. IIS is going to send the credentials the Application Pool is running under when trying to create the folders. This is generally defaulted to NETWORK SERVICE. Have a look at the user the Application Pool is running under, then check out the permissions of the root folder, and ensure that user has Write access. Once the Application Pool user has permissions -you're good.

Categories : C#

Error unable to connect to remote server when upload file to remote server
Using the FTP protocol requires a dedicated FTP server software running on the remote machine. FTP cannot access network drives without it. If you just want to access files on your network, start with this SO question: Copying files to a mapped drive while user is not logged in (scheduled task) For security reasons, I strongly recommend a few steps before: a) Do not open root shares like C$. b) Create specific shares on your "remote" server, where you grant access only to users for that specific purpose. Further reading on FTP: http://en.wikipedia.org/wiki/File_Transfer_Protocol

Categories : Vb.Net

To create a copy of object in java w/o clone,copy constructor and copy factory
You can just create a new object for NewDog using OldDog Have you considered something like this? NewDog dog = new NewDog(someOldDogObject); While constructor of NewDog can be. public NewDog(OldDog oldDog){ this.dogWeight = oldDog.dogWeight; // keeping the same weight this.dogName = "newDog" + oldDog.dogName; // changing your dog name as per rquirement. }

Categories : Java

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

"Target folder cannot be created" when trying to make Netbeans copy sources folder
As I had guessed, it was a Windows permissions issue. After doing pretty much the same thing over and over without the change sticking, it finally stuck, and I was able to get things working the way I wanted. Sigh...

Categories : PHP

Automatically copy contents of FTP folder to local Windows folder without overwrite?
Use wget for Windows. If you want to include subdirectories (adjust the cut-dirs number according to the depth of your actual remote path): cd /d C:MyDestination wget.exe --mirror -np -nH --cut-dirs=2 ftp://UserName:Password@MyFtpServer.com/var/MyFolder If you don't want subdirectories: cd /d C:MyDestination wget.exe -nc ftp://UserName:Password@MyFtpServer.com/var/MyFolder/* The "magic" bit (for this second form) is the -nc option, which tells wget not to overwrite files that are already there locally. Do keep in mind that old files are also left alone, so if a file on your FTP server gets edited or updated, it won't get re-downloaded. If you want to also update files, use -N instead of -nc. (Note that you can also type wget instead of wget.exe, I just included the extension to poi

Categories : Shell

Copy entire directory to output folder maintaining the folder structure?
Try XCOPY instead of COPY; e.g. XCOPY "$(SolutionDir)ResourcesTemplate" "$(TargetDir)" /s /i /y More info on XCOPY here... http://www.computerhope.com/xcopyhlp.htm

Categories : Visual Studio

Perl NET::SFTP::FOREIGN execute remote perl script
It doesn't seem to support that from looking at the docs on cpan for it. However you can Use ssh commands via Perl's system() or even IPC::Run3 if you have that installed see if you have a version of Net::OpenSSH installed already which is by the same author. I've used all these methods with success.

Categories : Perl

Use Sharepoint Copy web service to copy folder and contents
There is a simple solution to this problem , as its just about copy and paste use the simple XCOPY command XCOPY Copy files and/or directory trees to another folder. XCOPY is similar to the COPY command except that it has additional switches to specify both the source and destination in detail. To copy a folder including all subfolders XCOPY C:utils* D:Backuputils /s /i here /i defines the destination as a folder for more detail please refer this link

Categories : C#

how can I copy the files in path.txt to new folder with same folder structure?
You dont't need to read a list from a file. You could simply try this in command prompt: xcopy "full path to your folder" "full path destination folder" /e Below is what you get if you type xcopy /? in command prompt: Copies files and directory trees. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...] source Specifies the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies only files with the archive attribute set, doesn't change the attribute. /M Copies only files with the arc

Categories : Batch File

Copy folder keeping folder structure in target
How about cp -R /var/test/abc/ /home/test/? Assuming abc contains only xyz. If this is not the case, first create abc/ in test/ and then use your copy command.

Categories : Linux

WiX: Copy a file from local folder to installation folder
Actually I've figured out what the issue is. The problem is that the SourceDirectory of the CopyFile element supposed to point to the Directory tag id. Instead, I've used SourceProperty attribute of the CopyFlie tag, and also defined a Property separately, which made the use of the CopyFile element correct. So it worked.

Categories : Wix

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

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

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

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

SFTP Upload via Python and Pythonista with Paramiko. Can't create directory/subdirectory
You run into the same problem with FTP, you can't mkdir /some/long/path, you have to cd / mkdir some # ignore errors if it exists cd some mkdir long # ignore errors if it exists cd long mkdir path # ignore errors if it exists cd path I'm guessing that the historical reason for this model is to provide a simple boolean SUCCEED/FAIL for any command issued by the client. Having some fuzzy error like 'Couldn't make directory /some/long/path because directory /some/long doesn't exist' would be a pain in the ass to handle on the client side. In looking at the SFTP protocol spec re: filenames ( http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#page-15 ), it's unclear to me if clients are expected to understand '/' as a path separator in the context of making a directory - since you

Categories : Python

Can I migrate remote SVN to local disk without exporting dmp files on remote server?
You can dump only latest revision range with the -r switch. svnadmin dump REPOS_PATH [-r LOWER[:UPPER]] [--incremental] [--deltas] and then you can load this increment in the new repository. Reference: http://svnbook.red-bean.com/en/1.7/svn.ref.svnadmin.c.dump.html Example: http://www.vioan.ro/wp/2007/07/31/dumprestore-for-subversion-repository/

Categories : Svn

Remote PHP Debugging with Netbeans and XDebug (remote server)
Remember you need to set the Path Mapping in the Debugger tab inside Netbeans Options. Another little big problem I was having when trying to connect from NetBeans remotely was the SSH tunnel. You have to creat it for the port xdebug will work on, 9000 usually. If you experience network problems for a moment, the tunnel might "break" silently and NetBeans will be stuck in the holy "Waiting for connection..." state. In putty, you can right click and Restart Session, but this won't work. You will need to close the putty window and re open the session for it to work again. Hope it helps!

Categories : Misc

Write a function to dynamically create a new copy of string and return a pointer to the new copy (C)
I should start by pointing out that in my opinion, given the number and (especially) nature of the mistakes in this code, you probably need to get a good book on C. Your newString = s; overwrites the pointer instead of copying the string into the space you just allocated. Thus, you lose the pointer to what you just allocating (leaking the memory) without making a copy. You probably want to use strcpy instead of direct assignment. Your computation of the size you allocate isn't what you really want either. Typically, for a string of length N, you want to allocate N+1 bytes. You're currently attempting to allocat sizeof(int * strlen(s)) bytes, which shouldn't even compile.

Categories : C

How to copy a file to application folder in set up project during insatllation. File is in set up folder
If I'm understanding you correctly, this might solve your problem, or at least get you started: Include the file in the main project (for instance in a folder called "resources"). Right click the file in VS, choose properties, and set Copy to output directory to Coppy Always.

Categories : C#

How to create a folder then save an image to the created folder using fileuploader in C# asp.net?
Instead of FileUpload2.SaveAs(Server.MapPath(strpath) + filename); try FileUpload2.SaveAs(Path.Combine(strPath, filename)); you already know the physical save path - no need for Server.MapPath

Categories : C#

Can we create a new folder inside a standard deploy folder in JBoss?
You should check your deployment scanner config, which is kept in server/<profile>/conf/jboss-service.xml. The relevant part is: <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner" name="jboss.deployment:type=DeploymentScanner,flavor=URL"> ... <!-- URLs are comma separated and resolve relative to the server home URL unless the given path is absolute. [...] --> <attribute name="URLs"> deploy/ </attribute> ... <!-- Indicates if the scanner should recursively scan directories that contain no "." in their names. [...] --> <attribute name="RecursiveSearch">True</attribute> </mbean>

Categories : Java

PHP - Create a folder and save an image to that folder? Then display that photo?
You need to create the directory before you can move files into it. You can use the file_exists function to check on the directory first and then create it of needed: if (!file_exists('path/to/directory')) { mkdir('path/to/directory', 0777, true); } You may prefer other permissions.

Categories : PHP

Rails server command generates another folder in project's folder with default folders and files
This is because you are using rails 2 gem version, you can check by rails -v. As well you can see, there is no app/assets folder. there are only public/javascripts etc rails2 style directories Try to install rails 3 by gem install rails --version '>3.0.0'

Categories : Ruby On Rails



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