java - jQuery File Upload (Show uploaded images)

275

I'm creating a CMS platform with php & MySql. Ι'm using jQuery File Upload in order to upload images in the server and the database. The problem is that the uploader shows all the images of the folder. I want to show only images with a specific id from the database. How can i do this with java?

HERE IS THE CODE

<script id="template-download" type="text/x-tmpl">



{% for (var i=0, file; file=o.files[i]; i++) { %}
  <tr >
    <td>
      <span >
        {% if (file.thumbnailUrl) { %}
          <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
        {% } %}
      </span>
    </td>


    <td>
    <p ><strong>{%=file.title||''%}</strong></p>
<p >{%=file.description||''%}</p>
      <p >
        {% if (file.url) { %}
          <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
        {% } else { %}
          <span>{%=file.name%}</span>
        {% } %}
      </p>
      {% if (file.error) { %}
        <div><span >Error</span> {%=file.error%}</div>
      {% } %}

    </td>
    <td>
      <span >{%=o.formatFileSize(file.size)%}</span>
    </td>
    <td>
      {% if (file.deleteUrl) { %}
        <button data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
          <i ></i>
          <span>Delete</span>
        </button>
        <input type="checkbox" name="delete" value="1" >
      {% } else { %}
        <button >
          <i ></i>
          <span>Cancel</span>
        </button>
      {% } %}
    </td>
  </tr>
{% } %}
</script>

People are also looking for solutions to the problem: php - search do not search for letter "š"

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.