How would you impletement download and upload a file in php

Answer Posted / vijaya

refer this link for uploading


http://php-mysql-javascript-css.blogspot.com/

for files downloading you can use headers .

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment;
filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is php closing tag necessary?

559


Write a php script to get the largest key in an array?

517


Why do we use csrf token?

519


What are the three classes of errors that can occur in php?

528


What is the difference between explode () and split () functions in php?

615






How does session work in php?

532


What is echo and print in php?

503


How can you make a connection with mysql server using php?

513


Does wordpress run on php 7?

515


How to pad an array with the same value multiple times?

475


Tell me what is the use of explode() function?

546


What does csrf token mismatch mean?

623


When to use get and post request?

553


Where is session value stored php?

542


How many open modes available when a file open in PHP?

651