Hello,
Please check the Package Properties from here,
As per other Attributes, you shall find files object, here you can bind id with file name. Thus you will be able to attach/upload file thereby. I hope you have understood.
If you have kept just the file name you should keep the files in wp-content/uploads/download-manager-files
dir too. And for local files, you will not be able to attach files from the local PC drive directly, or you may please attach a live server file URL there. It will also help you upload files properly.
The JSON response will look like the following example:
{
"id": 6488,
"title": "The Alchemist",
"slug": "the-alchemist",
"description": "The Alchemist follows the journey of an Andalusian shepherd boy named Santiago.",
"excerpt": "The Alchemist is a novel by Brazilian author Paulo Coelho.",
"author": 1,
"status": "publish",
"parent": 0,
"tags": [
"novel",
"paulo-coelho"
],
"categories": [
16
],
"thumbnail": "https://example.com/wp-content/uploads/2019/01/the-alchemist.jpg",
"additional_previews": [
"https://example.com/wp-content/uploads/2019/03/the-alchemist-cover.jpg",
"https://example.com/wp-content/uploads/2019/03/the-alchemist-map.jpg"
],
"version": "3.0.0",
"link_label": "Download",
"quota": 0,
"download_limit_per_user": "100",
"view_count": 80,
"download_count": 14,
"package_size": "811.84 KB",
"access": [
"guest",
"subscriber",
"administrator"
],
"user_access": [
"admin"
],
"individual_file_download": "1",
"cache_zip": "-1",
"template": "link-template-calltoaction1",
"page_template": "page-template-1col-flat",
"files": {
"1": "The Alchemist.pdf"
},
"fileinfo": {
"1": {
"title": "The Alchemist",
"password": "",
"license_price": {
"statdard": "",
"extended": "",
"unlimited": ""
},
"price": ""
}
},
"package_dir": "",
"publish_date": "2019-04-01 12:00 am",
"expire_date": "2019-08-31 12:00 am",
"terms_lock": "1",
"terms_title": "Agree to terms",
"terms_conditions": "You can't redistribute without prior authorization.",
"terms_check_label": "Checkbox Label",
"password_lock": "1",
"password": "[123][456]",
"password_usage_limit": "2",
"linkedin_lock": "1",
"linkedin_message": "LinkedIn Share Lock message",
"linkedin_url": "https://www.wpdownloadmanager.com/",
"tweet_lock": "1",
"tweet_message": "Custom tweet message",
"twitterfollow_lock": "1",
"twitter_handle": "Shahriar",
"facebooklike_lock": "1",
"facebook_like": "",
"email_lock": "1",
"email_lock_title": "Subscribe To Download",
"email_lock_msg": "",
"email_lock_idl": "0",
"icon": "https://example.com/wp-content/plugins/download-manager/assets/file-type-icons/arrow.png",
"base_price": "12.00",
"sales_price": "10.00",
"sales_price_expire": "2019-08-31 12:00 am",
"pay_as_you_want": "0",
"license": {
"statdard": {
"active": "1"
},
"extended": {
"price": "22",
"active": "1"
},
"unlimited": {
"price": "32",
"active": "1"
}
},
"discount": {
"subscriber": "10",
"contributor": "20",
"author": "30",
"editor": "40",
"administrator": "50"
},
"enable_license": "1",
"enable_license_key": "1",
"free_downloads": [
"/Applications/XAMPP/wpdm/wp-content/uploads/2019/04/The-Alchemist-free-sample.pdf"
],
"meta_input":{
"meta_key" : "Hello"
}
}
here file attach should be like this,
"files": {
"1": "The Alchemist.pdf"
}
And for this default format, the file should be residing in wp-content/uploads/download-manager-files
, thus the package should create with fa file. Please let me know if you have other queries
Thanks