Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I create "my page" using httprequest to upload file, but it cannot get file upload.
page load forever when run to line code :"fs = cgi.FieldStorage(fp=fp, environ=environ)"
Any one help me.
Thank very must!
And this is my code:
from mako.template import Template
from openerp.modules import module
from openerp.addons.web.controllers.main import module_topological_sort
from openerp.addons.web import http
import cgi, os
import cgitb; cgitb.enable()
from httplib import HTTP
temp = """<html><body>
<form method="post" action="/sa/save">
<p>File: <input type="file" name="myfile"></p>
<p><input type="submit" value="Upload"></p>
_cp_path = '/sa'
def index(self, req, **kwargs):
def save(self, req, **kwargs):
environ = req.httprequest.environ
fs = cgi.FieldStorage(fp=fp, environ=environ)# delay forever when run this line
f = fs.getfirst('myfile')
fout = open(filepath,'w')
return "upload successfully"
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 6/4/14, 11:54 PM|
|Seen: 1177 times|
|Last updated: 3/16/15, 8:10 AM|