Jump to content
MakeWebGames

Recommended Posts

Posted

This will only let staff upload images to file images/username.

Called this file

staff_uploadimage.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Now make a file called staff_upload.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 
Posted

Your form action is upload.php yet the bottom file is staff_upload.php, you sure that's correct?

  • 1 year later...
Posted

shouldn't

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

be

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

"size" is in bytes, right?

Posted
Who you talking to [MENTION=70383]Tangled[/MENTION]?

oopsie... Dragon Blade I missed putting in the quotes

- - - Updated - - -

 

Who you talking to [MENTION=70383]Tangled[/MENTION]?

Reason I was asking is because when I was instructed in adding images to items I had to make a column for it in items. And for the username images I had to add a column in users

Posted

Not necessarily needs a field in database, if he is only allowing one to be stored in the directory of images/username

I take it he is naming the image the username, than just echoing the username field where the image name is echoed..

such <img src="/images/username/".$ir['username'].".png"> OR <img src="/images/username/".$r['username'].".png"> where ever he is echoing the image.

Posted

Sniko has a mod like this. He also posted it up for free (it was paid).

You should check it out and see how he did it.

I'm sure he wouldn't mind you editing his code aslong as he got some credits! :)

Posted
Sniko has a mod like this. He also posted it up for free (it was paid).

You should check it out and see how he did it.

I'm sure he wouldn't mind you editing his code aslong as he got some credits! :)

Right that's where I got mine. :)

Posted (edited)

I got bored, so made an automated AJAX image uploader.

Requirements; HTML5 browser that supports the FILE API.

Demo: Here

Codes (As is, on my site -- I used bootstrap to throw the page together quickly. You shouldn't need any of that.)

-- Index.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

-- uploader.js

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Be sure to include jQuery (I used 1.11) for this to work.

Edited by Guest
  • 2 weeks later...
Posted

[MENTION=50378]Guest[/MENTION] - Demo Website

<br />

<b>Warning</b>: move_uploaded_file(uploads/Screen Shot 2014-10-28 at 12.08.58 1.png): failed to open stream: Permission denied in <b>/var/www/html/uploader/index.php</b> on line <b>16</b><br />

<br />

<b>Warning</b>: move_uploaded_file(): Unable to move '/tmp/php81e8Vg' to 'uploads/Screen Shot 2014-10-28 at 12.08.58 1.png' in <b>/var/www/html/uploader/index.php</b> on line <b>16</b><br />

Posted
@Guest - Demo Website

<br />

<b>Warning</b>: move_uploaded_file(uploads/Screen Shot 2014-10-28 at 12.08.58 1.png): failed to open stream: Permission denied in <b>/var/www/html/uploader/index.php</b> on line <b>16</b><br />

<br />

<b>Warning</b>: move_uploaded_file(): Unable to move '/tmp/php81e8Vg' to 'uploads/Screen Shot 2014-10-28 at 12.08.58 1.png' in <b>/var/www/html/uploader/index.php</b> on line <b>16</b><br />

That's now fixed.

Updated the server a couple days back and it seems to have set some file/folder permissions to their defaults =/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...