On Thu, Oct 8, 2009 at 11:04 AM, Youngblood <youngbloodda...@gmail.com>wrote:
> > I figured the problem out, it was missing the upload folder. I didnt > copy that folder and the database over because the data on my computer > was test data and i didnt want to over write the real data on the > server. once i created the upload folder it works fine. > Would it be a good idea to have web2py check for the uploads folder > and create it if needed to prevent a similar problem from happening > again? > Great you figured it out! Should uploads, and database folders be checked by the framework (if it depends on it), or the app? This is defensive programming, and a question of where that responsibility lies - should it be run time, or admin / install time? In any case, you figured it out, so that is not too bad. And if, in general, some installation folder doesn't exist will it be a good thing at runtime to try to fix that, or raise an exception? (Other things might be amiss if the installation is incorrect, after all). I think things are fine as they are w.r.t. raising an exception in this case. - Yarko > > thanks for your help. > > On Oct 8, 11:43 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > can you try from a windows shell > > > > C:\\Inetpub\\wwwroot\\web2py\\applications\\init/databases\\..\\uploads > > \\ > > > > C:\\Inetpub\\wwwroot\\web2py\\applications\\init\\uploads\\ > > > > does any of them work? > > > > On Oct 8, 9:35 am, Youngblood <youngbloodda...@gmail.com> wrote: > > > > > I am getting the following error and i can't figure out why: > > > > > Traceback (most recent call last): > > > File "gluon/restricted.py", line 178, in restricted > > > File "C:/Inetpub/wwwroot/web2py/applications/init/controllers/ > > > inventory.py", line 344, in <module> > > > File "gluon/globals.py", line 102, in <lambda> > > > File "C:/Inetpub/wwwroot/web2py/applications/init/controllers/ > > > inventory.py", line 245, in update > > > File "gluon/sqlhtml.py", line 824, in accepts > > > File "gluon/sql.py", line 1866, in store > > > IOError: [Errno 2] No such file or directory: 'C:\\Inetpub\\wwwroot\ > > > \web2py\\applications\\init/databases\\..\\uploads\\Items.SmPicture. > > > > 8fa43e89b88be9d4.4944434d5f4153495f496e746567726174696f6e5f534d414c4c5f42472e6a7067.jpg' > > > > > I get this error message when i try to upload a picture. The strange > > > thing is that it works fine on my web2py setup on my laptop, but when > > > i uploaded it to the work server it gives me this error. I made sure i > > > was running the latest version of web2py on the server but i still get > > > this error. any ideas? > > > > > Here is part of the table in db.py: > > > db.define_table('Items', > > > .......other fields > > > SQLField('SmPicture', 'upload', label="Upload a Small Picture of > > > the Item"), > > > .......other fields > > > ) > > > > > Here is part of the controler inventory.py: > > > def update(): > > > .... blah blah blah > > > editItem = SQLFORM(db.Items, record=id, formname='editItem', > > > deletable=True, showid=False, > > > fields=['OrderNumber', 'Item', 'Description', 'MinimumOrder', > > > 'OrderInLotsOf', 'QuantityPricing', 'Price', > > > 'OnSale', 'SalePrice', 'weight', 'ItemCategory', > > > 'SmPicture', 'Manufacturer', 'SaleableItem']) > > > > > if editItem.accepts(request.vars, session, formname='editItem'): > > > response.flash = 'new record inserted' > > > redirect(URL(r=request, f='update', vars={'i':id, 's':0})) > > > > > any help will be much appreciated. > > > > > Thanks, David Youngblood > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---