I am trying to upload media using below procedure:
- Click on "Browse" of Image field in a sitecore item.
- Click on "Upload Media" button.
- Click on "Browse for Media files" and upload a new image.
By following the above procedure, I am getting this error message:
The maximum amount of data that you can upload is NaN undefined.
Hence the image doesn't upload. However I am able to upload image in Media Library and then after linking the same to the item but when trying to upload media directly from content item, I am getting the error.
How to solve this problem?
PFB Form tag statement
<form data-sc-id="Uploader" data-sc-databasename="master" data-sc-maxrequestlength="-1024" data-sc-executiontimeout="600" data-sc-destinationurl="/sitecore/media
library/Images/Social/Connector/download" data-sc-filesizeexceededtext="The maximum amount of data that you can upload is" data-sc-timeoutext="The media files could
not be uploaded. Please try again." class="sc-uploader row sc_Uploader_42 data-sc-registered" data-sc-require="/-/speak/v1/business/uploader.js" method="POST"
enctype="multipart/form-data">
<img class="sc-uploader-preview hide">
<div class="sc-uploader-content">
<span class="drag">
Drag and drop files here
<br>
or
<br>
</span>
<a href="#" class="btn btn-default sc-button sc_Button_14 data-sc-registered">
Browse for media files
<input class="sc-uploader-fileupload" type="file" name="files[]" multiple="" data-url="/api/sitecore/Media/Upload?
database=master&destinationUrl=/sitecore/media library/Images/Social/Connector/download">
</a>
<div class="sc-uploader-general-info">
<div class="sc-uploader-general-info-progressbar progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"
style="display: none;">
<div class="bar data-sc-registered" data-bind="style: { width: globalPercentage() + '%' }" style="width: 0%;"></div>
</div>
<div class="sc-uploader-general-info-data" style="display: block;">
<div class="sc-uploader-general-info-data-col col1">
<div class="sc-uploader-general-info-data-uploadingData" style="display: none;"><span data-bind="text: uploadedSize" class="data-sc-
registered">0</span> of </div><span data-bind=" text: totalSize" class="data-sc-registered">11.2 Kb</span>
</div>
<div class="sc-uploader-general-info-data-col col2">|</div>
<div class="sc-uploader-general-info-data-col col3">
<div class="sc-uploader-general-info-data-uploadingData" style="display: none;">
<span data-bind=" text: uploadedFiles" class="data-sc-registered">0</span> of
</div>
<span data-bind=" text: totalFiles" class="data-sc-registered">1</span> <span data-bind=" visible: totalFiles() > 1" class="data-sc-registered"
style="display: none;">Files</span>
<span data-bind=" visible: totalFiles() === 1" class="data-sc-registered">File</span>
</div>
</div>
</div>
</div>
</form>