Page 1 of 1

fopen() error, need some advice

Posted: Fri Mar 26, 2004 7:24 am
by BareKnuckles
I am new to php and I could use some advice.

I'm running php 4.3.4 and abyss server on a win98 machine.
php is installed correctly as I have tested it using phpinfo().
I get this error when executing a certain script that I wrote...


Warning: fopen(undeliverable email.txt): failed to open stream: No such file or directory in C:\Program Files\Abyss Web Server\htdocs\php\sendmixed.php on line 6

Warning: fread(): supplied argument is not a valid stream resource in C:\Program Files\Abyss Web Server\htdocs\php\sendmixed.php on line 7

These errors are associated with a script that allows users to upload a file to my server and then an email is sent to me. The file above (email.txt) is the file I am trying to upload using the form, so naturally it doesn't already exist in the location specified by the above "fopen" error.

What needs to be done to fix this?

just so you know:
register_globals=on
safemode=off

thanks!

Posted: Fri Mar 26, 2004 7:41 am
by patrikG
Please: don't use bold-font on an entire post. Makes me feel uncomfy in my chair, and when I am uncomfy in my chair, I am more likely to spill tea. And if I spill tea, I get upset. And if I get upset, Dr. Evil's cat gets upset. And we all know what happens, when Mr. Biggelsworth gets upset...;)

Apart from that: fopen is a file-function that opens a file and returns a resource-handle. If the file doesn't exist, you can't open it.

Would be helpful if you posted some code

In addition, have a look at http://uk.php.net/features.file-upload