Had the same problem, but found a fix for it.

3.1.0 is returning the full path in $_FILES['userfile']['tmp_name'],
instead of just the tmp file name. That is confusing
move_uploaded_file() and is_uploaded_file() and both return false,
even though the file was actually uploaded.

My solution for that is to use basename() on
$_FILES['userfile']['tmp_name']. For example:

$targetpath = /whatever/uploads
$tmpfile = basename($_FILES['userfile']['tmp_name']);
move_uploaded_file($tmpfile, $targetpath);

For some reason I can't see the tmp file, not sure if it actually is
on the hard drive, or remains in memory (scary).

Also, I can't retrieve the file type via $_FILES['userfile']['type'].
I checked the source and it looks like the [type] array is never set,
because quercus doesn't get a mime-type or something.

Any ideas?

Gregory Stewart


On 2/14/07, Anoop K Achuthan <[EMAIL PROTECTED]> wrote:
> Hi ,
> I'm also experiencing the same problem after upgrading to Resin-3.1.0 .
>
> Thanks,
> Anoop
> Markus Bopp wrote:
>
> >hi again,
> >
> >I tried a couple of things to get uploads work with php and resin but I
> >am totally stuck.
> >there are resources that say I should enable resin to allow uploads in
> >resin.conf, so I did.
> >
> >additionally I added all the upload-specific stuff into my webapps' web.xml
> >but I can't still upload anything. the $_FILES var shows that there is a
> >file upload (temp_name, size and stuff)
> >but there is no temp-file created in "WEB-INF/upload/" or anywhere on
> >the drive.
> >
> >the behaviour is the same for wamp and lamp stacks.
> >
> >below is my web.xml. In resin.conf I only added
> >
> ><multipart-form enable="true" upload-max="16M"/>
> >
> >inside the web-app-default tag.
> >
> >Thanks for your help. I really appreciate it!
> >Markus
> >
> >web.xml:
> ><web-app xmlns="http://caucho.com/ns/resin";>
> >  <multipart-form enable="true" upload-max="16M"/>
> >  <servlet-mapping url-pattern="*.php"
> >       servlet-class="com.caucho.quercus.servlet.QuercusServlet">
> >    <init>
> >      <php-ini>
> >        <sendmail_from>[EMAIL PROTECTED]</sendmail_from>
> >        <smtp_username>my_email_username</smtp_username>
> >        <smtp_password>my_email_password</smtp_password>
> >        <session.save_path>c:/tmp</session.save_path>
> >        <upload_tmp_dir>c:/tmp</upload_tmp_dir>
> >        <file_uploads>1</file_uploads>
> >        <upload_max_filesize>16M</upload_max_filesize>
> >        <post_max_size>16M</post_max_size>
> >      </php-ini>
> >      <script-encoding>iso-8859-1</script-encoding>
> >      <compile>false</compile>
> >    </init>
> >  </servlet-mapping>
> >  <database>
> >  <jndi-name>jdbc/mysql</jndi-name>
> >  <driver>
> >    <type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
> >
> ><url>jdbc:mysql://localhost:3306/joomla?useUnicode=true&amp;characterEncoding=UTF-8</url>
> >    <user>root</user>
> >    <password>test1234</password>
> >  </driver>
> ></database>
> ></web-app>
> >
> >
> >
>
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to