How to add a browse and uplod file feature to my site?

  • 39 Cent Stamp
  • Born
  • Born
  • 39 Cent Stamp
  • Posts: 1

Post 3+ Months Ago

I would like to add a "browse/upload" feature to my site where users could log in and upload files.

Client would log in and only have the ability to browse their drive, select a file and upload it. They can upload as many files as they want. They never have any other ability and they cant manage the files they uploaded ever.

I would like to have the ability to charge them a one time upload fee.

On the other end. I would like to have the ability to grant temporary access to a download after the client checks out and pays. I know this is an easy task because its how software vendors manage download sales.

If anyone understands my ramblings and knows of a service i could use or easily integrate into my site please help :) I need it!

Thanks Everyone
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

well the code is this for an upload box (note different browsers render this in different ways but it will still work all the same)
Code: [ Select ]
<input type="file" />
short and sweet! :infinity:
  • danyweb
  • Newbie
  • Newbie
  • danyweb
  • Posts: 9

Post 3+ Months Ago

If you want to do what you got to have knowledge of web programming.
I am Web developer, any questions, do not forget to consult.
  • bishop_ian
  • Newbie
  • Newbie
  • bishop_ian
  • Posts: 14

Post 3+ Months Ago

The HTML Code is this..

<h1>UPLOADING FILES</h1>
<form name="fupload" enctype="multipart/form-data" action="upfiles.php" method="post">
<input type="file" name="picture" />
<input type="submit" value="Submit" />
</form>
</body>

PHP code is...
Your "upfiles.php":
<header>
<?php
function UploadOne($fname)
{
$uploaddir = 'uploadedfiles/';
if (is_uploaded_file($fname['tmp_name']))
{
$filname = basename($fname['name']);
$uploadfile = $uploaddir . basename($fname['name']);
if (move_uploaded_file ($fname['tmp_name'], $uploadfile))
$res = "File " . $filname . " was successfully uploaded and stored.<br>";
else
$res = "Could not move ".$fname['tmp_name']." to ".$uploadfile."<br>";
}
else
$res = "File ".$fname['name']." failed to upload.";
return ($res);
}
?>
</header>
<body>
<?php
if ($_FILES['picture']['name'] != "")
{
$res = UploadOne($_FILES['picture']);
$filname = $_FILES['picture']['name'];
echo ($res);
}
?>

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: yasar123 and 84 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.