Sharing files between PC and remote web server via FTP - php

This may have been asked before, but I could not find the answer.
I am looking to share a folder/files on my desktop/local machine with a specific folder/files on my web server, similar to box.net.
In this folder:
I can give another person access to this remote folder and we can
share these files between us.
All the files will get automatically sent to the server when they are saved on the local machine.
Both myself and the user can see the files on the remote server.
I could do this manually with FTP, but I only want specific remote folders and to have this automated.
Thanks in advance.

You can mount a Remote Folder as local using SSH on Linux ...
Both server & local pc must using linux OS ....
This is a great tutorial ...
http://www.howtogeek.com/howto/ubuntu/how-to-mount-a-remote-folder-using-ssh-on-ubuntu
Hope this to help you

Related

How do I upload a file in a remote location to my localhost website?

I have a localhost port forwarded SSH tunnel between an Azure Linux VM and Localhost PC using PUTTY. So when I localhost:8080 on my windows PC, I see my static website hosted on the AzureVM.
I need to upload some remote files to this website. At the moment when I click the file upload on the localhost website, it searches for files on my local windows pc.
Is there any way I could make it look for files on another server(Or the same azure VM) or maybe Azure Blob storage?
Thanks!
Ok to upload through putty is a tedious process as you need code running on the linux machine to do it .
We generally use putty to control the AWS machine and run commands directly on it and use another FTP program like File Zilla , WinSPC or somthing similar for uploading
To upload a program directly with putty you have to write the protocol yourself or use a putty add-ons but its a pain to work with .
here some choices
https://helpdeskgeek.com/free-tools-review/the-best-ftp-tools-to-transfer-files-to-your-website-domain/
If you really want to go through the headaches of using putty to transfer files use this link as a start
https://www.hostknox.com/tutorials/ssh/putty/file-transfer

PHP - Transfer file from Server to Windows PC

I have tried a few SSH and SCP snippets to transfer files from a web server to a windows pc and I can't quite get it working. There are a combination of things I believe I need such as firewall permissions, php modules, etc.
What boggles my mind is, it is so easy to ssh to a linux machine because I know the username and password but for Windows, you don't REALLY have a username and sometimes don't even have a password.
That being said, here is what I need to do. I have a linux server online and need to send a XML file to a windows pc. Out of your experiences, what are the best php modules, snippets, and any tips that you followed to achieve this? I believe the IP I would use for my windows machine would be my public ip but what in the world would the password be.. I have no pw on my computer? Do I need extra software installed on my windows pc as well?
Any help is appreciated.
Without getting into your IP potentially being dynamic.
It sounds like you need a cron job on the web server. You could then set up a FTP/SSH server on your Windows PC to receive the file.
On the other hand if this file is in a website folder which has FTP access. You could FTP to the server from your Windows pc and get the file with an FTP client.
Programs such as FTPBox could sync this for you or Curl from the command line.
With a command line program like Curl on your Windows PC you could set up a cron job on your Windows pc to automate getting this file if you want to do this automatically.
There are a few other options like a virtual linux machine on your windows pc. Then you could SSH from there and set up shared folders etc.
But to put it as simply as my experience has taken me.
If you have a webserver use FTPS and use a FTP client on your PC.
or use a command line program like Curl to automate from windows pc
From the server you need a cron job to automate the process, but you need to setup some type of server to receive this reliably. You could have a PHP file call a script file with php exec() depending on your webservers permissions.
Your router and software firewall may need to be configured to allow the ports you use for the transfer.
Easiest option is FTP server on webserver and FTP client on windows machine.
There are a few options, so I hope this has helped somewhat, I haven't taken into account a few things like security, automation, permissions etc. So none of these could be your best option. :)
Hope this helps a bit
Edit: Just to add Windows doesn't come with SSH which might explain some of the username/password issues. When you set up a FTP server on your Windows pc you can set your credentials
Here is a guide for setting up FTP Server on Windows PC
https://www.howtogeek.com/140352/how-to-host-an-ftp-server-on-windows-with-filezilla/
Once you have a server setup on your pc, if you wish to go down the route of a creating a cron job on your webserver for automation, you will havve your credentials from your server setup.

Remote access server (xamp) using http

I have remote access to another computer, and I can access that computer using its ip address and xamp server is also installed on that remote machine.
Now what I want is to access the file placed in that wamp server such as .php file from my own computer, such as using http://something/file.php
How can I do this?
Try the ip of the remote machine plus the folder of the project which is located under htdocs folders on xampp.
For example,
192.168.1.1/folderName
I'm not sure that is going to help you but why no try!

XAMPP Security and Remote Access

Hello I am running tests on my XAMPP server.
Let's say we have the following scenario :-
My Laptop is running the server in a small Local Network.
And I am accessing my Server with my personal PC.
Is it possible to upload files to htdocs from my Personal PC to the Server Laptop?
If we assume that all security settings are turned off. Basically I need to remotely upload files to HTDOCS so I can use them from the server!
As far as I remember doesnt XAMPP come with a FileZilla server as part of the install?
So configure the fileZilla server on the laptop, create a userid and set that userid up to be able to see the htdocs folder.
Then install FileZilla client on the desktop PC. You can then use FTP ( FileZilla ) in just the same way you would if the site was running on a real hosted server.
FileZilla Server setup instuctions
No.
Web servers do not, by default, run any services that write file uploads to a directory on the server.
You'll need to run some kind of suitable service such as SFTP, Windows File & Print Sharing, or a web based file uploader script.

Windows network drive from PHP running on a linux environment

I have to check something if it works.
We have limited access to a Debian server via ssh. We have a PHP intranet solution running on this server, so we can run PHP scripts. We got the following scenario:
A windows network drive given: \\IP\folder$
We have to read this windows network drive from PHP under linux. I never did such thing.
We have no any rights to mount anything on the server. This drive may or may not accessable from the linux machine, I don't know. (I guess it's accessable, due to the scenario).
We didn't receive any user&pass for the drive, so I guess we don't need it.
The question is: is it possible to do this in this situation if everything was set up correctly on the customer side? If yes, how?
We can ask more information and configuration changes if we need it, but I'm wondering if we can do this now, because it's interesting.
Thanks in advance,
negra
You can use smbclient to access the share. You could consider it as a sort of 'ftp' client, but for accessing Windows shares instead. It can work without need for mounting, and you should be able to talk to it directly from PHP using popen() for bi-directional communication of commands/results.
However, this depends on the share actually being remotely accessible, and you having access rights to it (via a windows account or the share having 'everyone/read' permissions). If windows networking is firewalled and/or you don't have access permissions, then there's nothing you can do to access the files directly.

Categories