PHP create file in mapped drive directory

  apache, codeigniter, php, wamp, windows

Trying to create a file into a folder in the mapped drive (Z:)

The source code Im using is as follows:

$fileNumber = 'F2310XXXX';
$content = "; Test n; Date : ".date('d/m/Y H:i:s')."n; Filename : ".$fileNumber.".TXT";
$fp = fopen("//xx.xx.xxx.xxx/MC/".$fileNumber.".TXT","wb");
fwrite($fp,$content);
fclose($fp);  

The following error occur:

A PHP Error was encountered
Severity: Warning. 
Message: fopen(//xx.xx.xxx.xxx/MC/F2310XXXX.TXT): failed to open stream: Permission denied

Filename: controllers/Auth.php

Line Number: 76

Backtrace:

File: C:wamp64wwwmc-appadminapplicationcontrollersAuth.php
Line: 76
Function: fopen

File: C:wamp64wwwmc-appadminindex.php
Line: 315
Function: require_once

Please someone help to solve this issue as I tried almost all the solutions got it from google but no luck. All your help will be appreciated. Thanks in advance

Source: Windows Questions

LEAVE A COMMENT