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

can we swap two different string using php for example:-- before swapping:-- 1 string :-hello friend, 2 string :-my dear, after swapping that strings will be: 1.hello dear, 2.my friend.

0 Answers  


what type of images that the PHP version supports

4 Answers  


Tell me how is it possible to return a value from a function?

0 Answers  


Where is my php ini file?

0 Answers  


Why php is better?

0 Answers  






Hello Friends,I am seeking for a job in php having 9 months. exp.Please suggest any company openings.

0 Answers  


Are php variables global?

0 Answers  


What is pdo in php why use?

0 Answers  


What is the difference between explode and split?

0 Answers  


Explain what are some new features introduced in php7?

0 Answers  


Tell me what is the difference between unset() and unlink()?

0 Answers  


What are the ways we can destroy a session variable ?

3 Answers  


Categories