new upload script at rbj

July 7th, 2007

I spend a good part of the afternoon re-doing the upload script at Rice Bowl Journals.

For the better part of the past year I had major problems with this script, and I tried to look for the bug that was causing some failed uploads, but could never find it. The problem was that I created this huge script that tried to validate and check for problems, which in turn created a problem in checking the code for errors.

I would always just set it aside for another day. Until now…

So, I created another script totally from scratch, updated all the data structures, and just slowly put it all together piece by piece and debugging each line of code piece by piece as well.

The basic form:

<form enctype=”multipart/form-data” action=”http://ricebowljournals.com/index.php?action=19″ method=”POST”>
<input type=”hidden” name=”MAX_FILE_SIZE” value=”100000″ />
Choose a file to upload: <input name=”imagefile” type=”file” /><br />
<input type=”submit” value=”Upload File” name=”clicked” />
</form>

And, I think I finally created a custom-made upload script that is 100% workable with no bugs.

Well, if you’re an RBJ’er you’ll just have to try it for yourself and see if it uploads properly.

The basic upload snippet:

if ($_FILES['imagefile']['type'] == “image/gif) {

copy ($_FILES['imagefile']['tmp_name'], $destination.$_FILES['imagefile']['name'])
or die (”Could not upload the photo!”);

}

The supported image formats are: JPEG, GIF and PNG

And I hope that is the end of all the image upload problems members have been having.

*crosses fingers and knocks on wood*

Related Posts
  • Site Search
  • rbj search script
  • internet movie script database
  • vegas photos
  • Really Really Good FREE Scripts
  • MyBlogLog versus BlogCatalog
  • Leave a comment