I am creating a wordpress page that allows users to downloads a zip file after 5 secs. In it, I am calling a second page and pass POST parameters ( zip id :: to fetch zip path). The page is called but always as a pop up. I am looking for a <strong>clean download options, where without opening tabs or new window, download begins</strong>. Bypasses popup - blockers also.
I have tried two methods
A) Method 1 ( Jquery Post)
B) Method 2 (Submitting a form)
<strong>Edit</strong>
1) Looking for a POST method to implement the logic
2) Due to server restrictions, direct access to *.php files and *.zip files have been blocked
3) Parent Download Page should remain open in the process
Looking for a expert advice on this issue.
Thanks
I have tried two methods
A) Method 1 ( Jquery Post)
Code:
$.post(
"<?php echo get_permalink(get_page_by_title('Download Page')); ?>",
{attachment_path: "<?php echo $attachment[0]->ID ; ?>"
}
B) Method 2 (Submitting a form)
Code:
$( '<form action="" method="post" target="_parent" class="hide">
<input type="hidden" name="attachment_path" value="<?php echo $attachment[0]->ID ; ?>" />
<input type="submit" name="submit" value="submit" id="target-counter-button"/>
</form>'
).submit();
<strong>Edit</strong>
1) Looking for a POST method to implement the logic
2) Due to server restrictions, direct access to *.php files and *.zip files have been blocked
3) Parent Download Page should remain open in the process
Looking for a expert advice on this issue.
Thanks