Hmm, not sure, but shouldn't the destination path just be like so:
$destinationPath = public_path(). '/upload/' .Input::get('folder');
// leave off . $file?
I'm having a little bit of trouble with a script of mine.
I'm wanting to upload a file but it's not moving the file to the correct place, instead it's creating a tmp then a random string then the file. obviously this is not correct.
Here's the upload script:
$file = Input::file('file');
$destinationPath = public_path(). '/upload/' .Input::get('folder') . $file;
$filename = $file->getClientOriginalName();
$upload_success = Input::file('file')->move($destinationPath, $filename);
Input::get('folder') returns the number of the selected folder that corresponds to a folder number in the upload directory.
So the question is what am I doing wrong why is it no just moving the file to (in this instance) upload/4/mydoc.pdf
Instead it does upload/4/tmp/pjDRfe/mydoc.pdf
Hmm, not sure, but shouldn't the destination path just be like so:
$destinationPath = public_path(). '/upload/' .Input::get('folder');
// leave off . $file?
Please or to participate in this conversation.