Can you explain what you are trying to accomplish and what your models are? 
I do not understand from the code.

On Tuesday, 18 December 2012 13:51:12 UTC-6, ArNew wrote:
>
> Hi Everyone,
>
> I need help urgently.
>
> In my application, I am have included upload fields in Create and edit 
> page. Through create page, it was very straight forward with:
> <td>{{=form.custom.widget.attachment}}</td> (View)
> Field('attachment','upload',uploadfolder=os.path.join(request.folder, 
> 'attachments')) (DAL). 
> if form.vars.attachment:
>                 form.vars.attachment_name = 
> request.vars.attachment.filename
>                 id = 
> thisdb.service_attachments.insert(**thisdb.service_attachments._filter_fields(form.vars))
>  
> .(Controller) And this works great.
>
> That with Edit page is not the same, as it is not about editing the 
> current image, but uploading more attachments. So I tried doing something 
> like this:
>
> <input class="upload" id="service_attachments_attachment" 
> name="attachment" type="file" /> (view)
> if request.vars.attachment != '':
>                 form.vars.attachment = request.vars.attachment.file
>                 filename = request.vars.attachment.filename
>                 form.vars.attachment_name = filename
>                 id = 
> thisdb.service_attachments.insert(**thisdb.service_attachments._filter_fields(form.vars))
> This follows the very similar procedure of saving the encrypted version of 
> attachment name in the attachment field, but it changes the extension to 
> .txt for all the attachments. It saves the attachment as 
> service_attachments.attachment.b19d4ef38978e8e6.746d707437756c626f.txt 
> where as the orginal attachment is photo.JPG. So ideall it should save it 
> as  service_attachments.attachment.b19d4ef38978e8e6.746d707437756c626f.JPG. 
>
> Can anyone please help me with this?
>
>
>
>
>
>

-- 



Reply via email to