How to fetch a file from an internal server?

Asked

Viewed 66 times

2

I have a server running at home where I keep some files. I wanted to have on my page, which is on an external server, a way to fetch these files. Does anyone know how I can do this in PHP?

  • See if this helps you: http://www.revistaphp.com.br/artigo.php?id=48

  • What kind of software runs on this local server of yours?

  • @Andréribeiro Ubuntu server

1 answer

1

In this particular case I would perhaps use existing solutions such as Owncloud.

It has a feature called External Storage support and with it you can reference files hosted at other points such as:

Local
Amazon S3
Dropbox
FTP
Google Drive
OpenStack Object Storage
SMB/CIFS
ownCloud/WebDAV
SFTP
iRODS 

For the external Owncloud to get to the home server it can be by FTP if it is not solution to install Owncloud also on the home server. If possible, then it will become easier. Analyze!

That said, and with PHP as the question asks? The script running on the external server can with CURL get a list per directory each click. With the list will come the links to the same.

To put some security, creates a structure for an API and with OAUTH authorizes access. A little work, but it won’t be hard to do because we are talking about an online service for personal use where the demand will certainly not be too much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.