Ticket #466 (closed Bug: fixed)

Opened 5 months ago

Last modified 1 month ago

Forge upload - confusing error message

Reported by: damike Assigned to: armen
Priority: minor Milestone: 2.1.3
Component: Modules:Forge Version: SVN HEAD
Keywords: Cc:
SVN Revision (if applicable):

Description

Forge does complain about a not writeable directory if i do $form...->directory('does/not/exist').. (must contain a / )

Maybe should be changed to:

        public function directory($dir = NULL)
	{
		// Use the global upload directory by default
		empty($dir) and $dir = Config::item('upload.upload_directory');

		$realpath = realpath($dir);
		
		// Does the path exist?
		if($realpath === FALSE)
			throw new Kohana_Exception('upload.no_filepath', $dir);			
		
		// Make the path asbolute and normalize it
		$dir = str_replace('\\', '/', $realpath).'/';

		// Make sure the upload director is valid and writable
		if ($dir === '/' OR ! is_dir($dir) OR ! is_writable($dir))
			throw new Kohana_Exception('upload.not_writable', $dir);

		$this->directory = $dir;
	}

Change History

03/06/08 09:46:47 changed by damike

Ah sorry:

throw new Kohana_Exception('upload.no_filepath');	

04/11/08 16:33:37 changed by armen

  • owner changed from Shadowhand to armen.

04/12/08 21:34:43 changed by number5

  • component changed from Core to Modules:Forge.

06/10/08 19:43:30 changed by Shadowhand

  • milestone changed from 2.1.2 to 2.1.3.

07/09/08 00:50:08 changed by armen

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r3011