I am working with codeigniter and I have a form where I can add a new item.
In this form, I have an area where I can upload an image and put it into my database.
All the work is fine to incorporate into my database.
My question is, how can I add the image that I have uploaded to my folder?
Path: Here's my controller: Do you want to store the context of your image in the database (i.e. : You have a column that is a filename and you store it: myupload.jpg) or do you want to physically store the image in the database? If it is already there, then you want to use it to get information about your file Cheers nameofproject / imagens / banner /
Function Novo () {$ this-> Load-> Assistant (array ('form', 'url')); $ This- & gt; Load-> Library ('form_validation'); $ This- & gt; Form_validation- & gt; Set_relets ('banda', 'banda', 'required'); $ This- & gt; Form_validation- & gt; Set_reales ('data', 'data', 'required'); $ This- & gt; Form_validation- & gt; Set_riels ('hora_incoo', 'horror inad', 'required' numeric '); $ This- & gt; Form_validation- & gt; Set_resells ('horror_fim', 'hora fame', 'required | numerical'); $ This- & gt; Form_validation- & gt; Set_Rials ('Morada', 'Morada', 'Required'); $ This- & gt; Form_validation- & gt; Set_reales ('preco', 'preva,', 'required, numeric'); $ This- & gt; Form_validation- & gt; Set_riels ('aquisao_bilhetes', 'aqui� ¿half o delhas', 'required'); $ This- & gt; Form_validation- & gt; Set_riels ('descricao', 'observer § μes', 'required'); $ This- & gt; Form_validation- & gt; Set_reales ('image', 'image', 'required | [image / jpeg | image / png] | file_path [../../ fancy / banner /]'); If (! $ This-> Input-> Post ()) {$ this- & gt; Load-> Scene ("concert"); } And {$ dados = $ this- & gt; Input-> Post (); $ This- & gt; Load-> Model ("Dados_model"); $ Result = $ this- & gt; Grandfather_model- & gt; Inner ($ Daedoz); }} $ this-> Upload-> Data () Help Function
No comments:
Post a Comment