Browse Source

Fixed generate delete link and fixed web.config

tags/v1.3
Teknikode 5 years ago
parent
commit
886325546d
2 changed files with 7 additions and 6 deletions
  1. 5
    4
      upload/main.php
  2. 2
    2
      upload/web.config

+ 5
- 4
upload/main.php View File

@@ -55,9 +55,10 @@ Dropzone.options.TeknikUpload = {
this.on("success", function(file, responseText) {
obj = JSON.parse(responseText);
var name = obj.results.file.name;
var short_name = file.name.split(".")[0];
$("#upload-links").css('display', 'inline', 'important');
$("#upload-links").prepend(' \
<div class="row link_'+name+'"> \
<div class="row link_'+short_name+'"> \
<div class="col-sm-6"> \
'+file.name+' \
</div> \
@@ -65,14 +66,14 @@ Dropzone.options.TeknikUpload = {
<a href="<?php echo get_page_url('u', $CONF); ?>/'+name+'" target="_blank" class="alert-link"><?php echo get_page_url('u', $CONF); ?>/'+name+'</a> \
</div> \
<div class="col-sm-3"> \
<button type="button" class="btn btn-default btn-xs generate-delete-link-'+name+'" id="'+name+'">Generate Deletion URL</button> \
<button type="button" class="btn btn-default btn-xs generate-delete-link-'+short_name+'" id="'+name+'">Generate Deletion URL</button> \
</div> \
</div> \
');
linkUploadDelete('.generate-delete-link-'+name+'');
linkUploadDelete('.generate-delete-link-'+short_name+'');
});
this.on("removedfile", function(file) {
var name = file.name;
var name = file.name.split(".")[0];
$('.link_'+name).remove();
});
this.on("reset", function(file, responseText) {

+ 2
- 2
upload/web.config View File

@@ -10,8 +10,8 @@
<add input="{REQUEST_URI}" pattern="/(.+)" />
</conditions>
</rule>
<rule name="RewriteUserFriendlyURL1" stopProcessing="true">
<match url="^([a-zA-Z0-9]+)[\.]([^/]+)/([a-zA-Z0-9]+)/?$" />
<rule name="Delete Upload" stopProcessing="true">
<match url="^([a-zA-Z0-9]+)[\.]?([^/]+)?/([a-zA-Z0-9]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

Loading…
Cancel
Save