Hi team,
I've got my FTP credentials ready. Now, I'm looking to push files into it. Could you please provide guidance on how to do this? Alternatively, is there a module I can refer to for assistance?
Thank you.
Best regards,
Bhupendra
.
@bhupendra.doniwal, In our project we use the flysystemService, together with config settings to set the destination filesystems (be it FTP/SFTP/S3 buket)
This is a particular bit that is writting a file into the flysystemService, in case it helps you:
In this bit, the $fileSystem is a string referencing the key in the FileSystemConstants::FILESYSTEM_SERVICE config setting.
I'd say also check the filesystem and flysystem docs:
Thank you for your reply, @victor.vanherpt.
I've managed to connect to my FTP server using Flysystem and can successfully write files to it. Now, my goal is to push my exported order files to the FTP server. Do you have any suggestions on how to achieve this?
Appreciate your assistance.
Best regards,
Bhupendra
I think that's more application logic, no? If you are writting the files successfuly, you just need update the function so that it will write through the flysystemService. Or write a function that will read each of the files from the export directory and write into the filesystem.
If by 'push my exported order files' you mean that you used the DataExport module⦠I just had a quick look and apparently it's not using Spryker's filesystem module, and I don't have experience with it.
I'd say you need to create a plugin that will implement the DataExportConnectionPluginInterface ( vendor/spryker/data-export-extension/src/Spryker/Service/DataExportExtension/Dependency/Plugin/DataExportConnectionPluginInterface.php). Not sure if there's anything out of the box.
Probably someone with more experience with the DataExport module will be able to help you better.
@fsmeier do you know how I can change the connection? to directly export ftp
or is there any global configuration where all the files directly point to my ftp ?
Heyhey @bhupendra.doniwal ,
I am also not an expert in this area but @victor.vanherpt provided already pretty good ideas!
I would do something like the following:
src/Pyz/Service/Flysystem/Plugin/DataExport/FlysystemFtpDataExportConnectionPlugin.php
(or any other more suitable name) which implements the DataExportConnectionPluginInterface
write()
method of your newly created plugin (have also a look into vendor/spryker/data-export/src/Spryker/Service/DataExport/Writer/DataExportLocalWriter.php
which is the default writer to write the files locally as fallback)src/Pyz/Service/DataExport/DataExportDependencyProvider.php
All the best,
Florian