File Uploading (Suggestions) !?!

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
xofter2
Forum Newbie
Posts: 2
Joined: Mon Apr 19, 2010 9:18 am

File Uploading (Suggestions) !?!

Post by xofter2 »

Hello,

I want to create a php website which supports to upload files by admin, and which supports to attach images about the uploaded file.
I have been reading a lot of tutorials but no one is about what I need.
I'm novice into this, and I hope someone would be able to recommend me some tutorials about what I need.

Here is a site that I like: http://www.lianasims3.net/index.php
I don't want to copy this site, but I would like my site to have a similar system.

Thanks in advance.
Last edited by xofter2 on Mon Apr 19, 2010 3:55 pm, edited 1 time in total.
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: Suggestions !?!

Post by greyhoundcode »

xofter2 wrote:to upload files by admin, and which supports to attach images about the uploaded file.
Can you clarify what you mean? If you want to facilitate the uploading of (any type of) files then try something as follows:

Code: Select all

<?php
// Test if the file has been received
if ( (isset($_FILES['userfile'])) && ($_FILES['userfile']['error'] == UPLOAD_ERR_OK) )
{
    // OK, now do something with the file
    echo '<p>We have received the file.</p>';
}
elseif ( $_FILES['userfile']['error'] != UPLOAD_ERR_OK )
{
	// There was a problem
	echo 'Woops ... there was an error when dealing with this file.';
}
else
{
    // Display the upload form
?>
	
<!-- It is important to set enctype to multipart! -->
<form method="post" action="testfile.php" enctype="multipart/form-data">
    <input type="file" name="userfile" />
    <input type="submit" value="Upload!" />
</form>

<?php
}
?>
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Suggestions !?!

Post by califdon »

You asked for suggestions, mine is that you read our posting rules and change your Subject to describe what you really are asking for. General Subjects like "Suggestions (?)" are generally ignored by most of the people who might be able to help you. An appropriate Subject for your request might be "File uploading."
xofter2
Forum Newbie
Posts: 2
Joined: Mon Apr 19, 2010 9:18 am

Re: File Uploading (Suggestions) !?!

Post by xofter2 »

I will test it soon, and I will get back if I'll need more indications.
The topic title has been changed to File Uploading.

Thank you.
Post Reply