I'm trying to write a plugin for trac <http://trac.edgewall.org/> but I'm
missing sthg.
I'm trying to upload a file to the sever using the POST method this a
simplified example :
<form id="MyForm" name="input" action="" method="post">
<label for="attachment">URL :</label>
<input type="file" name="GanttFile" value=""/>
</form>
Now I'm trying to process the uploaded file ,read it and do some
modifications than save it or ask the user to choose where he wants to save
the file (export some data from the trac database)...I'm still blocked at
this level :
def process_request(self, req):
data = {}
if req.method=='POST':
file=req.args.get('GanttFile', 'value')
# and now I'm blocked !! how can I modify this file
# and then redirect or save it !
and if I try to display the content of the variable *file* I just get the
name of the file not all the path ? By doing something like this :
<input type="text" name="file" value ="$myfile" />
and in my source code :
def process_request(self, req):
data = {}
if req.method=='POST':
myfile=req.args.get('GanttFile', 'value')
# display the content
data.update({
'myfile': myfile
})
This will display only the file name ...I need the absolute path to do some
process !
I'm I missing sthg. ? is that the right way ?
Thanks !
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/trac-users/-/7UC_gIfW6kMJ.
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/trac-users?hl=en.