Changeset 2341


Ignore:
Timestamp:
Dec 17, 2009 1:51:02 PM (9 years ago)
Author:
kapilt
Message:

commit the ui changes for file the upload

Location:
ore.bigfile/trunk/ore/bigfile
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ore.bigfile/trunk/ore/bigfile/content.py

    r2340 r2341  
    9090    # instead of a ttw implementation. (ie don't allow the 
    9191    # user to point /etc/ 
    92     upload_dir = "/mnt/incoming" 
     92    upload_dir = "/mnt/apache-incoming" 
    9393     
    9494    def validateDirectoryFile(self, f_path ): 
  • ore.bigfile/trunk/ore/bigfile/skins/bigfile/bigfile_widget.pt

    r2340 r2341  
    4747 
    4848    <metal:define define-macro="file_edit" tal:define="showLink python:0"> 
    49       Treaty File 
     49 
    5050      <metal:block use-macro="here/widgets/file/macros/file_view" /> 
     51 
    5152      <div tal:condition="accessor" style="padding-top:1em;" 
    5253           tal:define="unit accessor; 
    5354                       size unit/get_size | python:unit and len(unit) or 0;"> 
     55 
    5456        <tal:hide_if_no_file condition="size"> 
    5557            <!-- these complex buttons have no reson to be here if there is not a file already uploaded --> 
     
    98100           </label> 
    99101       </tal:hide_if_no_file> 
     102 
    100103       <div style="padding-left:1.5em;padding-top:0.5em;"> 
    101104           <metal metal:use-macro="here/widgets/file/macros/file_upload"/> 
     
    132135      <div tal:condition="not: accessor"> 
    133136        <metal metal:use-macro="here/widgets/file/macros/file_upload"/> 
     137 
     138 
     139         <tal:block tal:condition="python: here.isDirectoryUploadEnabled() and here.getDirectoryFiles()" 
     140                    tal:define="upload_files here/getDirectoryFiles"> 
     141           <br/> 
     142 
     143           <label for=""> 
     144             Or Choose File from Upload Directory 
     145           </label> 
     146           <div style="padding-left:1.5em;padding-top:0.5em;"> 
     147             <select tal:attributes="name string:${fieldName}_upload_dirfile; 
     148                                     id string:${fieldName}_upload_dirfile"> 
     149               <option  
     150                  tal:repeat="ufile upload_files" 
     151                  tal:attributes="value ufile/path" 
     152                  tal:content="string:${ufile/filename} (Size ${ufile/size})"> 
     153                 File Name (Size 3Gb) (Created 2009/12/12) 
     154               </option> 
     155             </select> 
     156           </div> 
     157         </tal:block> 
    134158      </div> 
    135159 
  • ore.bigfile/trunk/ore/bigfile/widget.py

    r2340 r2341  
    11 
     2import os 
    23 
    34from Products.Archetypes.atapi import FileWidget 
     5 
    46from zope import component 
    57from ore.bigfile import interfaces 
     
    2527            file_path = instance.REQUEST.form[upload_key] 
    2628            if instance.validateDirectoryFile(file_path): 
    27                 return open(file_path), {} 
     29                fh = open(file_path) 
     30                 
     31                try: # attempt to remove the uploaded file 
     32                    os.remove(file_path) 
     33                except OSError: 
     34                    pass 
     35                return fh, {} 
    2836 
    2937        frontend = component.getUtility( interfaces.IFrontendFileServer ) 
Note: See TracChangeset for help on using the changeset viewer.