Developer Support »

Problem uploading file. Warning: move_uploaded_file  (See more user questions)

Hi

I suspect it's something on your server or internet connection that is
causing the script to bomb.

There is also a maximum post setting in php.ini (post_max_size) in addition
the the max filesize. Check the setting for it.

6 meg is a pretty big file to upload. It might be the case that the script
is timing out (if not the internet connection or webserver). You can add
some code to prevent the script from timing out, but check the max post size
first. To prevent the script timing out, put this code at the top (just
after <?php):

set_time_limit(0);

(I haven't as yet looked at your form)

Any questions, just let me know.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

----- Original Message -----
Sent: Tuesday, April 14, 2009 9:04 PM
Subject: FormToEmail-Pro script


> Charles,
> Another issue has come up with the script for file uploads. The
> formtoemail
> php script consistently bombs with the upload of any file over about 6
> megabytes and sometime with smaller files. Our php.ini is currently set at
> 50 megabytes and I have no files size limit set in your php script. Could
> you try this out and see what I am talking about? Here is the url of our
> form page for file upload (ignore the "maximum file size" text on the
> page)
> http://www.
>
> -----Original Message-----
> Sent: Tuesday, April 14, 2009 3:47 AM
> Subject: Re: FormToEmail-Pro script
>
> That's great, ! Thanks for letting me know.
>
> Any questions, just let me know.
>
> Best wishes.
>
> Charles Sweeney
> https://formtoemail.com
> The world's easiest feedback script!
>
> ----- Original Message -----
> Sent: Tuesday, April 14, 2009 1:29 AM
> Subject: RE: FormToEmail-Pro script
>
>
>> Charles,
>>
>> Thanks for all of your help. Also with the assistance of the network
>> solutions guys we finally determined that you were correct about the
>> directory path.
>>
>> -----Original Message-----
>> Sent: Sunday, April 12, 2009 12:26 PM
>> Subject: Re: FormToEmail-Pro script
>>
>> Hi
>>
>> Thanks for the update. Indeed, uploading files is common, and is why I
>> suspected there was something wrong with your setup.
>>
>> Maybe give it a rest for a day and return to it fresh!
>>
>> Just looking at your error message again. It shows the script is here:
>>
>>

>>
>> ...and your file is (supposed to be) here:
>>

>>
>> Note that the first one uses the full directory path. Try putting that
>> directory path in the script, in the $path_to_uploaded_file option
>>
>>
>> and this is where the files will be uploaded.
>>
>> You could try it with the data directory, like so:
>>

>> Basically what I am doing here, is using the FULL directory path to
>> wherever
>>
>> it is you want the files uploaded. Remember in the error, the file could
>> not be found. All we need to do is locate it correctly.
>>
>> I am only getting the above paths from the error messages. You might
>> need
>> to consult your host for confirmation of the correct FULL directory path
>> to
>> your webspace.
>>
>> Any questions, just let me know.
>>
>> Best wishes.
>>
>> Charles Sweeney
>> https://formtoemail.com
>> The world's easiest feedback script!
>>
>> ----- Original Message -----
>> Sent: Sunday, April 12, 2009 4:45 PM
>> Subject: RE: FormToEmail-Pro script
>>
>>
>>> Charles. Thanks for the reply.
>>>
>>> I have tried the script with the upload to the same directory that the
>>> script is in with no luck. Our hosting service stated that using PHP to
>>> upload files to their server is common. They are unable to provide any
>>> additional clues to the problem. I am in one of those situations where
>>> everyone is pointing the finger at the other guy. And although I have
>>> rudimentary knowledge of this stuff I am not an expert programmer so I
>>> am
>>> sort of caught in the middle.

>>> -----Original Message-----
>>> Sent: Saturday, April 11, 2009 12:20 PM
>>> Subject: Re: FormToEmail-Pro script
>>>
>>> Hi
>>>
>>> 775 should be sufficient on conventional setups.
>>>
>>> Permission issues are outwith the control of the script. The script, or
>>> PHP
>>>
>>> to be specific, needs permission to write to the appropriate directory.
>>> This is down to the setup of the server. There's nothing PHP or my
>>> script
>>> can do if the server does not permit it to write to a directory.
>>>
>>> Are you stating a specific directory for the uploads? If so, try using
>>> the
>>> script in its default state, which will upload the files to the same
>>> directory that the script is in (just wondering if your server will
>>> allow
>>> PHP to write to the same directory that the script is in). You can get
>>> a
>>> fresh script here, if you need it:
>>>
>>> https://formtoemail.com/download.php
>>>
>>> Of course I am just guessing at your setup here. Only your host can
>>> advise
>>> for sure.
>>>
>>> Any questions, just let me know.
>>>
>>> Best wishes.
>>>
>>> Charles Sweeney
>>> https://formtoemail.com
>>> The world's easiest feedback script!
>>>
>>> ----- Original Message -----
>>> Sent: Friday, April 10, 2009 2:31 PM
>>> Subject: RE: FormToEmail-Pro script
>>>
>>>
>>>> Charles,
>>>>
>>>> I just spent an hour on the phone with Network Solutions (our hosting
>>>> service) and here is what they told me. We have "share hosting" and the
>>>> maximum level of permissions that can be placed on any folder or file
>>>> are
>>>> 775.
>>>> Is there a workaround that will allow the formtomail script to work
>>>> with
>>>> permissions of 775 or below?
>>>>
>>>> -----Original Message-----
>>>> Sent: Friday, April 10, 2009 4:21 AM
>>>> Subject: Re: FormToEmail-Pro script
>>>>
>>>> Hi
>>>>
>>>> Thank you for your purchase.
>>>>
>>>> You are trying to upload a file to the server, as opposed to attaching
>>>> it
>>>> to
>>>>
>>>> the email?
>>>>
>>>> Looks like a permissions issue. The error is saying that the file does
>>>> not
>>>> exist. The directory permissions probably do not allow PHP to write to
>>>> the
>>>> directory. Try changing the permissions to 777. Server permissions
>>>> are
>>>> down to the setup of your server, so you should consult your host if
>>>> you
>>>> have more questions about it.
>>>>
>>>> Have a look also at this page on my support section, which deals with
>>>> uploads/attachments:
>>>>
>>>> https://formtoemail.com/developersupport/not_receiving_attachments.php
>>>>
>>>> Any questions, just let me know.
>>>>
>>>> Best wishes.
>>>>
>>>> Charles Sweeney
>>>> https://formtoemail.com
>>>> The world's easiest feedback script!
>>>>
>>>> ----- Original Message -----
>>>> Sent: Friday, April 10, 2009 1:00 AM
>>>> Subject: FormToEmail script
>>>>
>>>>

>>>>> Comments: I just purchased your pro-version. I am getting the
>>>>> following
>>>>> error message when trying to upload a file with the form. Please
>>>>> advise.
>>>>>
>>>>> Warning: move_uploaded_file(/)
>>>>> [function.move-uploaded-file]: failed to open stream: No such file or
>>>>> directory in
>>>>>
>>>>
>>>
>>
> //formtoemailpro.ph
>>>> p
>>>>> on line 1509
>>>>>
>>>>> Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to
>>>>> move '/' to '/'
>>>>> in
>>>>>
>>>>
>>>
>>
> //formtoemailpro.ph
>>>> p
>>>>> on line 1509