-3

I installed yii2 fileupload extension with:

  1. php version 7 and linux (putty)
  2. php version 7 and 5 and window (cmd)

but failed!

message that shown to me on composer is :

./composer.json has been updated

Loading composer repositories with package information

Updating dependencies (including require-dev)

Package operations: 2 installs, 0 updates, 0 removals

– Installing kartik-v/bootstrap-fileinput (v4.4.8): Loading from cache

– Installing kartik-v/yii2-widget-fileinput (dev-master c549564): Cloning c549564

Failed to download kartik-v/yii2-widget-fileinput from source: Failed to clone https://github.com/kartik-v/yii2-widget-fileinput.git, git was not found, check that it is installed and in your PATH env.

sh: git: command not found

Now trying to download from dist

– Installing kartik-v/yii2-widget-fileinput (dev-master c549564): Loading from cache

Package mongosoft/yii2-upload-behavior is abandoned, you should avoid using it. Use mohorev/yii2-upload-behavior instead.

Writing lock file

Generating autoload files.

and when i used this command :

echo '<label class="control-label">Add Attachments</label>';

echo FileInput::widget([
    'model' => $model,
    'attribute' => 'attachment_1',
    'options' => ['multiple' => true]
]);

this error happend :

Class ‘kartik\widgets\FileInput’ not found

and message that shown to me on cmd was too long!!

Have resources been changed? What can I do?

Is there a way to do it manually?

you can see this extension at : yii2 fileupload extension

Hamed B
  • 183
  • 1
  • 12

1 Answers1

3

Well, the first error shows that you must install git (for example in ubuntu you can do it with $ sudo apt install git). The second error is because of a blur on the namespace of FileInput documentation. Based on This line of code, you should use kartik\file\FileInput as the used namespace.

meysam
  • 1,754
  • 2
  • 20
  • 30