Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:57:55+00:00 2026-06-11T04:57:55+00:00

I have a html page which lists all the file names in a folder

  • 0

I have a html page which lists all the file names in a folder and common file-operations as anchor tags next to them.When a user clicks a file operation say delete,the user is prompted if he is sure he would like to delete the selected file.It works almost flawlessly but,when a file name that has spaces and special chars ex:(My Track [Ezee’s].mp3) is encountered it fails.Is there a workaround to this.Any help or pointers in the right direction would be greatly appreciated.Thanks

HTML

    <tr class="filetable_entry_alt">
<td>
    <input type="checkbox" name="sample10 with spaces (ezee's).jpg" value="file">
</td>
<td>
    <a href="/mnt/sdcard/DCIM/sample10 with spaces (ezee's).jpg" title="sample10 with spaces (ezee's).jpg" class="thumb" rel="cb">
        <img src="/thumbnail.wft?image=/mnt/sdcard/DCIM/sample10 with spaces (ezee's).jpg&amp;kind=micro&amp;lm=1308828676000" alt="">
        <b>
            <img src="/thumbnail.wft?image=/mnt/sdcard/DCIM/sample10 with spaces (ezee's).jpg&amp;kind=micro&amp;lm=1308828676000" alt="" style="width:150px; height:150px;">
        </b>
    </a>
</td>
<td>
    <a href="/mnt/sdcard/DCIM/sample10 with spaces (ezee's).jpg" title="sample10 with spaces (ezee's).jpg">
        sample10 with spaces (ezee's).jpg
    </a>
</td>
<td>
    06/23/11 12:31 PM
</td>
<td>
    1.76 MB
</td>
<td>
    <a href="#" onclick="return confirmDel('/mnt/sdcard/DCIM/sample10 with spaces (ezee's).jpg', '/mnt/sdcard/DCIM/?');">
        delete
    </a> | 
    <a href="#" onclick="return confirmRen('/mnt/sdcard/DCIM/','sample10 with spaces (ezee's).jpg','/mnt/sdcard/DCIM/?');">
        rename
    </a>|
     <a href="#" onclick="return confirmCopy('/mnt/sdcard/DCIM/','sample10 with spaces (ezee's).jpg', '/mnt/sdcard/DCIM/?');">
        copy
    </a>
</td>

JS code

var selectedFile = 'noFile';
var selectedFile2 = 'noFile';

function confirmDel(t, p) {

    var confirmDeltxt = 'Are you sure you want to delete ' + t + '?';
    selectedFile = decodeURIComponent(t);
    selectedFile2 = decodeURIComponent(p);
    jQuery.prompt(confirmDeltxt, {
        callback: confirmDelcallback,
        buttons: {
            Delete: 'ok',
            Cancel: 'cancel'
        }
    });
    return false;

}

function confirmDelcallback(v, m, f) {
    if (v != undefined && v == 'ok') {

        var form = document.forms.filelist;
        form.action.value = 'delete';
        form.data_file.value = selectedFile2 + "/" + selectedFile;
        form.submit();


    }
}


function confirmRen(p, f, cp) {

    selectedFile = decodeURIComponent(p);
    selectedFile2 = decodeURIComponent(f);

    var confirmRentxt = 'Enter new file name:<br /><br /><input type="text"       id="newPath" name="newPath" value="' + f + '" />';


    jQuery.prompt(confirmRentxt, {
        submit: confirmRensubmit,
        callback: confirmRencallback,
        buttons: {
            Rename: 'ok',
            Cancel: 'cancel'
        }
    });
    return false;
}

function confirmRensubmit(v, m, f) {
    an = m.children('#newPath');

    if (v == 'ok') {
        if (f.newPath == "") {
            an.css("border", "solid #ff0000 1px");
            return false;
        }
    }
    return true;

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:57:57+00:00Added an answer on June 11, 2026 at 4:57 am

    You must escape ‘ in lines like this when you output HTML. Resulting HTML should look like this:

    onclick="return confirmCopy('/mnt/sdcard/DCIM/',
                                'sample10 with spaces (ezee\'s).jpg', 
                                '/mnt/sdcard/DCIM/?');"
    

    (new rows just for better appearance)

    How you will do that depends on your server side language, but replacing ‘ with \’ should be enough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an html page which has a link called open. Once the link
I have this html page which is very simple, it contains a text box
I have a html page which consist of a table & I want to
A very simple question. I have a html page which is divided into three
i have a html page in which i enter data which then submits and
I have an html page called search.html which contains sliders, they work perfectly in
I have a textarea within an HTML page into which my users paste content.
I have a html page with a form. The form has Div which gets
I'm having a strange problem. I have a HTML page with PHP code which
I have a page which contains a html.RenderPartial, that renders an ASP.NET MVC partial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.