R
R
Roman2015-05-18 16:54:49
Yii
Roman, 2015-05-18 16:54:49

How to upload a file in Yii2? , without a submission form?

I'm doing a REST API, and I get no form with <?= $form->field($model, 'file')->fileInput() ?> The
question is how to save a file without a form? For example if I converted the base64 string to an image and saved it?
Or I generated a file and I had to save it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Grechushnikov, 2015-05-18
@maxyc_webber

how do you send data to the site?
if you use rest, then you obviously use the post and get and you obviously pass something there. what you pass there is the inputs. also send files

V
vyachin, 2015-05-19
@vyachin

Of course you can. Read here abandon.ie/notebook/simple-file-uploads-using-jque... everything is very simply described here and with examples

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question