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

Explain me what is sql injection?

540


What happens if an expected input field was not submitted?

519


What is csrf verification?

519


Why php was called as personal home page?

534


Explain about objects in PHP?

560






Which is the correct way to check if a session has already been started ?

509


What is the use of $_server and $_env?

555


What are the steps for the payment gateway processing?

528


How we can get the number of elements in an array?

8397


How do you count numbers in php?

488


What is pdo classes?

548


What is variable function php?

538


Differentiate between require and include?

529


how to track user logged out or not? when a user is idle?

514


Explain Type juggling?

556