Closed i-panov closed 6 years ago
- By default, yii2 uses the yii\web\UploadedFile class to load files. How do I use it with this library?
See yii2tech/ar-file for the example.
- There is still a method yii2tech\filestorage\DownloadAction, but I did not really understand how to use it...
It is a substitution for the native bucket file download mechanism See Bucket::getFileUrl() docs - I can not explain more detailed.
- It is not shown at all whether it is possible to set a key file when connecting to ssh.
See https://github.com/yii2tech/file-storage/blob/master/src/sftp/Connection.php#L56-L80
@klimov-paul Thanks for the answer. What about the limit on the number of files in the folder? I have a task to make for example that no more than 1000 files are saved in one folder. That is, there are subfolders with random names (uniqid). When there are more than 1000 files in the folder, a new folder with a random name is created and the files are saved already in it. It is considered that when there are too many files in one folder, it can brake... This is not my idea, but I need to do this. I did not find a way to view the list of files on a remote server using this library.
For example, in this the library does this almost as I described, but instead of the unique identifiers, the sequence numbers of the folders.
And what if I need to save the files to the root? I tried to specify an empty key in buckets, but then when I get the url to the file, I get an extra slash: example.com//myfle.txt
Unfortunately, you do not have a detailed wiki, and on the README not everything is clear.
By default, yii2 uses the
yii\web\UploadedFile
class to load files. How do I use it with this library? For example, it has asaveAs
method. It already implements the storage logic. And of course he does not use this library. Should I not use it at all?There is still a method
yii2tech\filestorage\DownloadAction
, but I did not really understand how to use it... There's not a single example. Only in actions one line. And what's inside? And how do I make a form on the front? How to name the field to work? In general, it would be nice to have another widget for the frontend, as for example in this library. In general, for example, there are forms when some more text fields are loaded with the file. So this action does not always work.It is not shown at all whether it is possible to set a key file when connecting to ssh.