2

I want to be able to connect to a distant folder based on user's input. The system has to be compatible with different sharing protocols so I can't just use FTP in every case (distant folders are not necessarily implementing FTP).

Right now opendir('//HDD/Music'); works because this is a public folder, but for others that need username/password it doesn't work. I already tried opendir('//username:password@HDD/Music'); which doesn't work.

I don't want to mount the folder either (net use) because this code is intended to be used by normal users and shouldn't interfere with their environment.

To sum up:

opendir('//HDD/Public_folder'); works opendir('//username:password@HDD/Public_folder'); doesn't work

opendir('ftp://HDD/disk1/Public_folder'); works opendir('ftp://username:password@HDD/disk1/Private_folder'); works

Thanks.

user3803848
  • 179
  • 1
  • 13
  • `allow_url_fopen` is disabled. If you enable error reporting, you'll probably see that that message. Furthermore, you should just use a an ftp connection instead, as that's generally the most widely accepted amongst shared hosting environments. – Ohgodwhy Jul 14 '14 at 18:28
  • I checked and allow_url_fopen is enabled in my conf. Also, the system has to be compatible with several protocol, for example a user who has a shared smb folder on his network has to use smb. – user3803848 Jul 14 '14 at 18:38

0 Answers0