if the file is uploaded it should work. try replace fname =request.folder + "static/" + pname + ".xml" with fname =os.path.join(request.folder,"static",pname + ".xml")
which is more portable, although I do not thing this is the problem. It is more likely the file is not being uploaded. On Feb 20, 11:11 am, reyelts <[email protected]> wrote: > I'm trying to read a file from my static directory. I construct the > name as follows: > > fname = request.folder + "static/" + pname + ".xml" > logging.debug("profile " + fname) > > if os.path.exists(fname): # if we have a file > # > logging.debug(" file exists") > else: > logging.debug(" file does not exist") > > This works fine in standalone web2py and in the GAE development > environment. But the GAE production environment, it can't find the > file. > > 02-20 08:55AM 10.116 /canyonezt/default/user/login 200 210ms > 160cpu_ms 43api_cpu_ms 2kb Mozilla/5.0 (Windows; U; Windows NT 5.1; en- > US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.89 Safari/ > 532.5,gzip(gfe) > 75.71.67.211 - - [20/Feb/2010:08:55:10 -0800] "GET /canyonezt/ > default/user/login HTTP/1.1" 200 2582 - "Mozilla/5.0 (Windows; U; > Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/ > 4.0.249.89 Safari/532.5,gzip(gfe)" "1-0- > test2.latest.canyonezt.appspot.com" > D 02-20 08:55AM 10.134 > profile /base/data/home/apps/canyonezt/1-0-test2.340023137640691244/ > applications/canyonezt/static/COMP_profile.xml > D 02-20 08:55AM 10.134 > file does not exist > > The path/fname appears to be ok. And it seems to be able to find other > files in the static directory (I have some images there that are > pulled in by the HTML). > > Is there something special I have to do in production GAE to be able > to read files like this? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

