cancel
Showing results for 
Search instead for 
Did you mean: 

Save files/data to precise directory

Save files/data to precise directory

With magento 2.0, I'm trying to save files to a precise directory.

 

Bascially, when I save a file (a txt file with references to images), I need to edit these references upon save to make the images relative to the txt position.

Basically:

storage_xyz/
         |-> file.txt (with references to ./tex/tex1.jpg)
         |-> tex/
                |-> tex1.jpg
                  (...)



But, 

$mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
$result = $uploader->save(
    $mediaDirectory->getAbsolutePath($base_media_path)
);

saves the file.txt into 

storage_xyz/i/p/file.txt

How can I save my other files into 

storage_xyz/i/p/tex/tex1.jpg

?

 

By the way, why does magento inserts this "i/p" stuff?

Thanks in advance...