This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-08-18 13:46:03

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

PHP file upload

I keep trying to do it, but keep failing!  I can't seem to get the script from w3schools to work on my site.  Does anyone know a better script that works?


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#2 2012-08-18 14:08:15

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: PHP file upload

It's simple, you don't need to use someone else's script.

Just look at the move_uploaded_file command.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#3 2012-08-18 14:46:08

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: PHP file upload

jvvg wrote:

It's simple, you don't need to use someone else's script.

Just look at the move_uploaded_file command.

I have!  It's still not working...  hmm


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#4 2012-08-18 14:57:09

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: PHP file upload

XenoK wrote:

jvvg wrote:

It's simple, you don't need to use someone else's script.

Just look at the move_uploaded_file command.

I have!  It's still not working...  hmm

Well, here's a script I can think of off the top of my head. I can't guarantee how well it will work.

Note that in processor.php, you need to change /path/to/uploaded/ to the path where you want uploaded files to go.
Also, this may be a problem with the server.

Upload page:

Code:

<form action="processor.php" method="post" enctype="multipart/form-data">
<input type="file" name="theFile" />
</form>

processor.php:

Code:

<?php
if (is_uploaded_file($_FILES['theFile'])) {
     move_uploaded_file($_FILES['theFile']['tmp_name'], '/path/to/uploaded/' . $_FILES['theFile']['name']);
}
?>

http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#5 2012-08-18 15:06:23

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: PHP file upload

yeah, it's definitely something wrong with the server.  I'm gonna contact godaddy, see what they can do about it...


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#6 2012-08-18 15:15:47

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: PHP file upload

XenoK wrote:

yeah, it's definitely something wrong with the server.  I'm gonna contact godaddy, see what they can do about it...

I have read in various places on the internet that GoDaddy hosting leaves something to be desired, and this may be one of them.

According to godaddyhostingsucks.com (which may be a bit biased), their support won't help you too much either.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#7 2012-08-18 15:20:33

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: PHP file upload

Have you chmod-ed the target directory with write permissions?
Are you sure your form tag includes ' enctype="multipart/form-data" '?


/* No comment */

Offline

 

#8 2012-08-18 15:33:17

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: PHP file upload

TheSuccessor wrote:

Have you chmod-ed the target directory with write permissions?
Are you sure your form tag includes ' enctype="multipart/form-data" '?

I'll have to chmod the directory.


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#9 2012-08-18 21:21:35

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: PHP file upload

Remembering the problems you had with session variables, it is likely a server problem.  hmm


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#10 2012-08-18 23:33:19

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: PHP file upload

jvvg wrote:

Remembering the problems you had with session variables, it is likely a server problem.  hmm

The session variables actually turned out to be a minor coding mistake...


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#11 2012-08-18 23:49:40

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: PHP file upload

XenoK wrote:

jvvg wrote:

Remembering the problems you had with session variables, it is likely a server problem.  hmm

The session variables actually turned out to be a minor coding mistake...

Oh. My bad.  tongue


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#12 2012-08-19 00:15:20

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: PHP file upload

jvvg wrote:

XenoK wrote:

jvvg wrote:

Remembering the problems you had with session variables, it is likely a server problem.  hmm

The session variables actually turned out to be a minor coding mistake...

Oh. My bad.  tongue

Youre fine, you are just trying to help.  I understand that you dislike godaddy because it simply supported SOPA - people do value their privacy.  However, i have come to like their services regardless of their history, i really got what I paid for.  Just trying to get across a point there :p  anyways, i might try to fix it tomorrow.  Who knows, i may have misconfigured something myself :p


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#13 2012-08-19 10:15:19

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: PHP file upload

XenoK wrote:

jvvg wrote:

XenoK wrote:


The session variables actually turned out to be a minor coding mistake...

Oh. My bad.  tongue

Youre fine, you are just trying to help.  I understand that you dislike godaddy because it simply supported SOPA - people do value their privacy.  However, i have come to like their services regardless of their history, i really got what I paid for.  Just trying to get across a point there :p  anyways, i might try to fix it tomorrow.  Who knows, i may have misconfigured something myself :p

Actually, in this case, the reason I don't like you using GoDaddy is that I think you're taking a Scratch collab way too seriously and putting too much money into it (especially when mine hardly has any money).


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#14 2012-08-19 10:43:14

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: PHP file upload

jvvg wrote:

XenoK wrote:

jvvg wrote:


Oh. My bad.  tongue

Youre fine, you are just trying to help.  I understand that you dislike godaddy because it simply supported SOPA - people do value their privacy.  However, i have come to like their services regardless of their history, i really got what I paid for.  Just trying to get across a point there :p  anyways, i might try to fix it tomorrow.  Who knows, i may have misconfigured something myself :p

Actually, in this case, the reason I don't like you using GoDaddy is that I think you're taking a Scratch collab way too seriously and putting too much money into it (especially when mine hardly has any money).

I'm using the website more than just a way to advertise my collaboration.  I'm using it to practice my skills, and take my organization to new heights, more than just making scratch projects.  Thanks for you concern though.


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#15 2012-08-19 11:38:12

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: PHP file upload

Yes!!  Got it working!!!


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#16 2012-09-29 22:31:23

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: PHP file upload

XenoK wrote:

yeah, it's definitely something wrong with the server.  I'm gonna contact godaddy, see what they can do about it...

No jvvg forgot the submit button


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=onlineStatus&amp;type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1

Offline

 

Board footer