Yii Framework Forum: Upload pdf file to other server - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Upload pdf file to other server Rate Topic: -----

#1 User is offline   syazri 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 09-October 17

Posted 09 October 2017 - 04:33 AM

Hi,

I have tried to upload a file using this CUploadedFile.

I have tried upload to a local server and it success.

But the problem is i want to keep the uploaded file to another server.

I have tried using the map network drive but still the file not save in other server.

This is example

$DocumentDirectory = 'Z:\Candidate';

$cv_path = CUploadedFile::getInstance($model,'cv_path');

if($cv_path->name){
$cv_name = 'cv_' . $_POST['Tblhrcandidate']['ICPassportNo'] . '_' . $cv_path->name;
$cv_ext = pathinfo($cv_name,PATHINFO_EXTENSION);
$cv_pathUrl = $DocumentDirectory.'\\'.$cv_name;
$cv_pathUrlSave = $cv_name;
$cv_path->saveAs($cv_pathUrl);
}
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users