pekebyte / pekeUpload

jQuery html5 file uploader plugin
http://pekebyte.github.io/pekeUpload
Other
82 stars 73 forks source link

pekeUpload.js:192 Uncaught TypeError: Cannot read property 'name' of undefined #25

Open 1714578436 opened 8 years ago

1714578436 commented 8 years ago

I got 2 problems:

error message:

  1. pekeUpload.js:192 Uncaught TypeError: Cannot read property 'name' of undefined
  2. Uncaught ReferenceError: json is not defined

my problems:

  1. always return this error when upload was succeeded, why?
  2. some thing gotta strange: 2.1 case 1: first time to select file for fuPictureUrl, upload complete, but return error as title. and then select file for fuQRCodeUrl, upload complete, but return error as title and fuPictureUrl's upload result repeat one time.

(in other words, when I finish all step of case 1, I can see 3 upload result, fuPictureUrl 2 times, fuQRCodeUrl one time)

2.2 case 2: first time to select file for fuQRCodeUrl, reutrn error as title and upload was not complete. and then select file for fuPictureUrl, upload complete, but the upload result of fuPictureUrl display on fuPictureUrl and fuQRCodeUrl.

(in other words, when I finish all step of case 2, I can see the same upload result on fuPictureUrl and fuQRCodeUrl)

my code brief:

<script type="text/javascript" charset="utf-8" src="assets/js/pekeUpload.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function () {

    $("#fuPictureUrl").pekeUpload({
        maxSize: 0,
        allowedExtensions: "jpeg|jpg|png|gif",
        multi: false,
        btnText: "Select your picture",
        onSubmit: false,
        url: "ashxs/file_upload_handler.ashx"
    });

    $("#fuQRCodeUrl").pekeUpload({
        maxSize: 0,
        allowedExtensions: "jpeg|jpg|png|gif",
        multi: false,
        btnText: "Select QR Code",
        onSubmit: false,
        url: "ashxs/file_upload_handler.ashx"
    });
</script>

<form id="form1" runat="server"><!--Begin Form-->
<table>
<tbody>
<tr>
    <th>Picture</th>
    <td>
        <input id="fuPictureUrl" name="fuPictureUrl" type="file" />
    </td>
</tr>
<tr>
    <td colspan="2">
        <div>Size: Width, 306px; Height, 376 px</div>
        <div>Format: jpeg, png, gif。</div>
    </td>
</tr>
<tr>
    <th>Name</th>
    <td>
        <input id="tbFullName" type="text" />
    </td>
</tr>
<tr>
    <th>IM</th>
    <td>
        <input id="tbVXinCode" type="text" />
    </td>
</tr>
<tr>
    <th>Mobile</th>
    <td>
        <input id="tbMobile" type="text" />
    </td>
</tr>
<tr>
    <th>Office</th>
    <td>
        <input id="tbOffice" type="text" />
    </td>
</tr>
<tr>
    <th>QRCode</th>
    <td>
        <input id="fuQRCodeUrl" name="fuQRCodeUrl" type="file" />
    </td>
</tr>
<tr>
    <td colspan="2">
        <div>Size: Width, 430px; Height, 430 px</div>
        <div>Format: jpeg, png, gif</div>
    </td>
</tr>
<tr>
    <th>修理厂</th>
    <td>
        <select id="garages" name="garages">
            <option value="">-请选择-</option>
<%=Garages %>
        </select>
    </td>
</tr>
</tbody>                            
</table>
<div>&nbsp;</div>
<!--ToolsStript-->
<div class="btn-toolbar">
    <div class="btn-group">
        <span id="save" class="btn btn-sm">保存</span>
        <span id="cancel" class="btn btn-sm">取消</span>
    </div>
</div> <!--ToolsStript-->
</form><!--End Form-->
pekebyte commented 8 years ago

Hi, thanks for using PekeUpload, I notice the message error 2 and 1, and I've fixed in the 2.1.1 release 2c9f3bafb89247ef20f9b911a3b9f49554d7d57b. Please download and report if your problem persists, thanks!