Welcome Guest, Not a member yet? Register   Sign In
Can I use the upload library inside a model?
#4

[eluser]Isern Palaus[/eluser]
[quote author="überfuzz" date="1259588090"]Yes it's possible. I can't really see what you mean, why would it be a problem..?[/quote]

I'm getting a error: You did not select a file to upload. with the code above. Sad

[quote author="umefarooq" date="1259590506"]well to keep your code clean do image uploading and resizing in controller just send you file path to you model to save image name and path, keep you model only to deal with database, where in controller you can put you image uploading and resizing code, you can see you model code its quite difficult to understand the code.[/quote]

Well... probably it's the way to go but I've to repeat this code on:

productos/productoAdd
productos/productoUpdate
fabricantes/fabricanteAdd
fabricantes/fabricanteUpdate
categorias/categoriaAdd
categorias/categoriaUpdate
gestion/envioUpdate
gestion/pagoUpdate

If I've to change a little thing... I've to change all the files. What I'm looking for is a way to have less code for future modifications. At this moment, my upload doesn't works in a model... which seems to me a nice way to organize it. You're right to mantain the model only to dial with database but what is a solution to organize the upload without repeting me out?

Thank you two,
Isern


Messages In This Thread
Can I use the upload library inside a model? - by El Forum - 11-29-2009, 09:20 PM
Can I use the upload library inside a model? - by El Forum - 11-30-2009, 01:34 AM
Can I use the upload library inside a model? - by El Forum - 11-30-2009, 02:15 AM
Can I use the upload library inside a model? - by El Forum - 11-30-2009, 03:18 AM
Can I use the upload library inside a model? - by El Forum - 11-30-2009, 03:30 AM
Can I use the upload library inside a model? - by El Forum - 11-30-2009, 05:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB