kasparkuldkepp / upload-at-click

Automatically exported from code.google.com/p/upload-at-click
0 stars 0 forks source link

Check if uploaded file is empty .(note:I have href="#" id="uploader") #37

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
i am inserting a path of my uploaded file.This path gets inserted even when 
file is not uploaded.I am uploading it on click of href,hence i have given href 
an id="uploader".How do i check whether file is uploaded or not.the 
conventional way of ($"#selector").val() is not working..what should i do??

What version of the product are you using? On what operating system?
using it on windows 7.

Please provide any additional information below.

Original issue reported on code.google.com by jay...@experiencecommerce.in on 5 Aug 2013 at 8:09

GoogleCodeExporter commented 8 years ago
upclick({
    element: uploader,
    action: '../services/file_service.php', //your service file
    onstart: function (filename) {
        alert('Start upload: ' + filename);
        my_file = filename;  //var my_file=""; declare this inside your dom ready
    }

The validation part!!!

  if (my_file == "" && file_name == "") {
     $(".error_msg").text("please upload your file");
     $("#uploader").focus();
     $("#email").css('border', '2px solid red');
     return false;
 }

Original comment by jay...@experiencecommerce.in on 27 Aug 2013 at 10:48