Tuesday, October 28, 2014

cant open uploaded file

Hi, I am trying to open a file that has been uploaded to attachments folder on a cakephp project. I have a list of files I select after uploading . This works fine on my PC but on the remote server it is throwing a 503 error which I have no idea in what to do . The error logs show nothing.

 public function download2($attachment_id = null){  		  		$file = $this->Tutor->Attachment->find('first', array('conditions' => array('Attachment.id' => $attachment_id), 'recursive' => -1));  		//pr($file); die;  		if(!empty($file)){      		$this->response->file($file['Attachment']['url'], array('name' => $file['Attachment']['org_filename']));  			//Return reponse object to prevent controller from trying to render a view  			return $this->response;			  		}    	  		else{  			$this->Session->setFlash(__('Error encountered while downloading the file. Please, try again.'),'flash_alert');  		}  		     }

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: