FTP OR SFTP use
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
Comments
-
.
0 -
@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:
1 -
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,
Bhupendra0 -
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.1 -
@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 ?
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
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:- create the plugin
src/Pyz/Service/Flysystem/Plugin/DataExport/FlysystemFtpDataExportConnectionPlugin.php
(or any other more suitable name) which implements theDataExportConnectionPluginInterface
- Use the FlysystemService to write to your ftp within the
write()
method of your newly created plugin (have also a look intovendor/spryker/data-export/src/Spryker/Service/DataExport/Writer/DataExportLocalWriter.php
which is the default writer to write the files locally as fallback) - Register your plugin in
src/Pyz/Service/DataExport/DataExportDependencyProvider.php
All the best,
Florian
1 - create the plugin
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random