Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Allow uploading files #1

Open
sarpaykent opened this issue Mar 1, 2018 · 5 comments
Open

[Feature Request] Allow uploading files #1

sarpaykent opened this issue Mar 1, 2018 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@sarpaykent
Copy link

Hello,

It would be great if we could accept uploading files (for example for blog posts) over Rest API. That could be done with middleware or custom function before executing $this->model->save([Post], [Allowed Params]). I can implement that feature too, if we can decide how we should do this.

@SparoHawk
Copy link
Member

Yes, this is something that could be done. Could you propose the structure you have in mind?

@sarpaykent
Copy link
Author

sarpaykent commented Mar 1, 2018

Well, to support multiple images for single record I suggest to create table (for example: media) then we need something like:

We need a table to store media:
id <- Media id
owner_id <- ID of the record that has this media
model_name <- Full name of the class that uses this media
path(maybe url?) <- relative path of the file
...
(More information about the file can be stored, users can extend this model to store what they need or they can use their own table.)

To handle upload and relations model behavior can help. beforeCreate, beforeUpdate, and afterDelete events can get some options like; directory path, post field, number of maximum/minimum images... We can get default upload directory, media model from config.

Note: I'm not sure but this could be out of the scope of this project.

@kaioken
Copy link
Member

kaioken commented Mar 2, 2018

@HackHers the scope of this project is to make api development easier for all phalcon developers so adding images is a important aspect. Now, we may need to add 2 drivers to store the image info, table or redis.

After that I'm good, @SparoHawk ?

@SparoHawk
Copy link
Member

@kaioken Considering popular choices I'd say we need 4 drivers:

  • Local Storage
  • Amazon S3
  • Redis
  • Database

@kaioken
Copy link
Member

kaioken commented Jan 31, 2019

this features is going to be release with canvas

@kaioken kaioken added the enhancement New feature or request label May 12, 2019
@kaioken kaioken added this to the Version 0 milestone May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants