How would you impletement download and upload a file in php

Answers were Sorted based on User's Feedback



How would you impletement download and upload a file in php..

Answer / 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

How would you impletement download and upload a file in php..

Answer / master

uploading is down using html file tag and later on moved to
the destination location.

for downloading we can use the pdf format so once we click
on the link the pdg format of the file will be downloaded

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More PHP Interview Questions

How is it possible to propagate a session id?

0 Answers  


What is the difference between php and cakephp?

0 Answers  


Explain type casting and type juggling.

0 Answers  


What is difference between required and require_once in php?

0 Answers  


What is the difference server side and browser side validation?

0 Answers  






What is difference between print_r and echo in php?

0 Answers  


What is the difference between echo and print statement?

11 Answers   Rushmore Consultancy,


What is the method to execute a php script from the command line?

0 Answers  


What is the difference between array_pop() and array_push()?

0 Answers  


What are the two main string operators?

0 Answers  


What is the difference between == and === in php?

0 Answers  


What is php explain?

0 Answers  


Categories