jake2025's avatar

Upload, import, delete xls

Greetings pros,

Is there a way on how can i upload an xls file that is coming from other directory?

like for example.

Filename: test.xls

Directory: C:\Users\ABC\Downloads or C:\Users\Jake\desktop

I'm using this

http://www.maatwebsite.nl/laravel-excel/docs/import

for importing the data.

Any help would be greatly appreciated.

0 likes
7 replies
nolros's avatar

@devinfd has done some of that work, might be able to provide some direction

devinfd's avatar
devinfd
Best Answer
Level 13

Perhaps I don't understand the question. To import a file from any location just pass the load method the path to the file. ex:

$readerObject = Excel::load('path/to/file.xlsx');

// or
use Maatwebsite\Excel\Excel;

public function __construct(Excel $excel)
{
    $this->excel = $excel;
}

$readerObject = $this->excel->load('path/to/file.xlsx');
jake2025's avatar

What i mean is. Is there a way to dynamically get the xls' file location without providing the file's directory?

thepsion5's avatar

If you don't provide the directory, it'll be impossible for your server to find it. It's kind of like calling a friend up and saying "can you pick up this package for me? It's in a mailbox."

2 likes

Please or to participate in this conversation.