Hello, Thank you! Now I have it working: function upload_file(file,dir) local f = file if f and next(f) then local name = f['name'] local file = f['contents'] local dest = io.open(dir.."/"..name, "wb") if dest then local bytes = file dest:write(bytes) dest:close() return "/"..dir.."/"..name --retunrs the location to save in db end end end here I call it: category.cat_img = upload_file(web.POST.cat_img, "__imgs/produtos/categorias") category:save() Em 31/8/2010 21:48, ykhuang escreveu:
|
_______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/