##// END OF EJS Templates
file-upload: allow specfing custom filename for uploaded archives.
marcink -
r1683:b17a8f3c default
parent child Browse files
Show More
@@ -660,7 +660,6 b' class FilesController(BaseRepoController'
660 660 file_obj = r_post.get('upload_file', None)
661 661
662 662 if file_obj is not None and hasattr(file_obj, 'filename'):
663 filename = file_obj.filename
664 663 content = file_obj.file
665 664
666 665 if hasattr(content, 'file'):
@@ -2008,6 +2008,10 b' BIN_FILENODE = 7'
2008 2008 input {
2009 2009 display: none;
2010 2010 }
2011 margin-top: 10px;
2012 }
2013 .file-upload-label {
2014 margin-top: 10px;
2011 2015 }
2012 2016 p {
2013 2017 margin-top: 5px;
@@ -56,11 +56,17 b''
56 56 </div>
57 57 <div id="upload_file_container" class="fieldset" style="display: none;">
58 58 <div class="filename-label left-label">
59 ${_('Filename')}:
60 </div>
61 <div class="right-content">
62 <input class="input-small" type="text" value="" size="46" name="filename" id="filename_upload" placeholder="${_('No file selected')}">
63 </div>
64 <div class="filename-label left-label file-upload-label">
59 65 ${_('Upload file')}:
60 66 </div>
61 67 <div class="right-content file-upload-input">
62 68 <label for="upload_file" class="btn btn-default">Browse</label>
63 <span id="selected-file">${_('No file selected')}</span>
69
64 70 <input type="file" name="upload_file" id="upload_file">
65 71 <p>${_('or')} <a id="file_enable" href="#">${_('Create New File')}</a></p>
66 72 </div>
@@ -155,10 +161,8 b''
155 161 });
156 162
157 163 $('#upload_file').on('change', function() {
158 if (detectIE() && detectIE() <= 9) {
159 if (this.files && this.files[0]) {
160 $('#selected-file').html(this.files[0].name);
161 }
164 if (this.files && this.files[0]) {
165 $('#filename_upload').val(this.files[0].name);
162 166 }
163 167 });
164 168
General Comments 0
You need to be logged in to leave comments. Login now