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 to include variables in double-quoted strings?

0 Answers  


Define urlencode() and urldecode() used in php?

0 Answers  


how to open & closing opening period in fico

0 Answers   NS,


What are the core OOP’s concepts?

2 Answers  


How to get tabels from database in php andd display it in the table form using codelgniter? plz help me

2 Answers  






Is PHP an open source software?

0 Answers  


What is a namespace in php?

0 Answers  


Inside a php function, what param needs to be set in order to access a global variable?

0 Answers  


What is factory pattern in php?

0 Answers  


What is magic function in php?

0 Answers  


How can you propagate a session id?

0 Answers  


What is the main difference between php 4 and php 5?

0 Answers  


Categories