Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This way worked for me:</p> <p>1- In the upload.class.php change:</p> <pre><code>$a = $_REQUEST["path"]; $this-&gt;options = array( 'script_url' =&gt; $this-&gt;getFullUrl().'/', 'upload_dir' =&gt; dirname($_SERVER['SCRIPT_FILENAME']).'/'.$a.'/', 'upload_url' =&gt; $this-&gt;getFullUrl().'/'.$a.'/', </code></pre> <p><em>So that you get the directory name by request</em></p> <p>2- Then there are three places where you should put your path variable so that you post it to upload.class.php whenever you request it.</p> <p>a- In the form (default with id="fileupload") put an hidden input named path</p> <pre><code>&lt;input type="hidden" name="path" value="whatever_you_want_the_path" id="fileuploadpth"&gt; </code></pre> <p>b- make an global javascript variable </p> <pre><code>var mypath = "whatever_you_want_the_path" </code></pre> <p>c- Add into Jquery File Uploader initialization </p> <pre><code>$('#fileupload').fileupload({'formData' : { 'path' : mypath }}); </code></pre> <p>d- In the js where existing files are loaded change the get url</p> <pre><code>$.getJSON(this.action </code></pre> <p>to</p> <pre><code>$.getJSON(this.action+'index.php?path='+ path </code></pre> <p>e- in the template on html change data-url for the delete button</p> <pre><code> data-url="{%=file.delete_url%} </code></pre> <p>to</p> <pre><code> data-url="{%=file.delete_url%}&amp;path={%=path%}"&gt; </code></pre> <p><strong>P.S. Be careful when using this because this trick may lower the security of your application since directory name is stored in client side</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload