Dear friends:

I can't upload the file with upload module.
After I submit ,it say ...
========================
delete List URL size
http://tm-studio.3322.org/homebbs/files/_0 bytes

Note: changes made to the attachments are not permanent until you save this post
========================
there are no files be upload...

what's wrong?

BTW,My English is not very good, But I will try my best to improve it.
I hope you will know what I wrote.

thanks~~ :)
Reading

Comments

Stefan Nagtegaal’s picture

Reading, what configuration are you using? Are you using Clean Url's on or off? Are you using Private downloads or Public downloads? Did you changed the standard 'files'-directory ainto an selfmade one?

According to what you are saying, I think you are using private downloads and are using another directory, than the standard 'files'-directory..

But please let me know for sure...

reading’s picture

Thank you,stefan nagtegaal.

My configuration is ...

=========================
Clean Url ----- off
Public downloads
and
use 'files'-directory .(I try to change the directory but nothing change.)
=========================

Er..

I found something.

-------------------------------
the 'Temporary directory' .

'Location where uploaded files will be kept during previews. Relative paths will be resolved relative to the file system path.'

I have used "c:\windows\temp" and "tmp"-directory but no effect.
------------------------------

Maybe 'Temporary directory' is a point.

thanks again. :)

sepeck’s picture

Create a files subfolder in your Drupal directory.
Give IUSR_SITENAME create rights on the folder.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

reading’s picture

I did.also can't upload.

reading’s picture

carlmcdade’s picture

That's me answering a question about file upload and Drupal on PHP5.

Are you using PHP5 ?
---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.hivemindz.com

reading’s picture

Yes. I use IIS+PHP5.
I have added the line in file.inc.

$file = new stdClass();

but still can't upload file. :<

carlmcdade’s picture

I remember that ASP pages had to have write permissions in IIS sites. You might check this. I haven't used IIS in a year so I am a bit rusty. Are you using XP or 2003 II6 ? or IIS5 I have both but there are slight difference in how to approach the configuration.

---------------------------
info for Drupal installation
__________________________
Carl McDade
Information Technology Consult
Team Macromedia
www.hivemindz.com

reading’s picture

I use 2003 IIS6.
I check the permission.I think that's no problem.

Because I can use Image module and upload image.

Maybe change my php5 to php4 is better...

reading’s picture

Carl...Thank you! You enlighten me on temp's permission!
Temp directory 's permission is the key!!!

now.I can use upload module!

HOhhhhhhhhhhhhhhhh~~~~~~~~~~

djhomeless’s picture

Can you comment on what you did to get this component working??

I am having the same problem, but I'm not using IIS. When I try to upload a file using public method, I get the following:

http://domain.com/files/_0 bytes

When I change it to private method, I get the following:

system/files?file=_0 bytes

I've tried changing my file and tmp paths a million times, and have even chmoded the directories to 777, still nothing!

Sadly no errors in the logs. If anyone can help I would appreciate it as I'm going totally mad.

Thanks

Geoffrey

shane birley’s picture

...the same problem today. No errors, no file appears, and the same system/files directory being displayed.

I get exactly the same thing: system/files?file=_0 bytes

This is becoming quite the show stopper for my client.

-
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

Taran’s picture

There needs to be some documentation here. Apparently some can do it, and others can't.

Same problem. Again.

sepeck’s picture

look at the reply below and check the permissions on your php.ini upload file.

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

shane birley’s picture

That was the first thing I tried. May I point everyone's attention to this node:

http://drupal.org/node/17364

-
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

sepeck’s picture

ahh, well that would be why I self host. :)

-sp
---------
Test site...always start with a test site.
Drupal Best Practices Guide

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

shane birley’s picture

I would agree. But, I got tired of having to maintain the servers, etc. So, now, I can phone people and yell at them if stuff breaks. :)

-
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

hat-1’s picture

I was ripping out hair over this problem for a while until I realised that the default php.ini directive for temporary uploads was /tmp. My webspace provider server didn't have a /tmp directory that was accessible.

The solution was to create a tmp directory in my webspace and override the upload_tmp_dir php ini setting using the following code: (inserted into includes/conf.php)

ini_set("upload_tmp_dir", "/webspace/corporate/htdocs/tmp");

Hope that helps..

chall3ng3r’s picture

i'm stuck with the same problem.

i've found another topic here discussing similar prob, but there i found someone saying its because of php "safe mode"=on, if "safe mode"=off thing will work.

im my situation, "safe mode"=off. so, there's no prob with it.

i donno, if my hosting provider have /tmp or not. but i've a tmp folder in / of my account. when i login using ftp, i get list of dirs which include "public_html", tmp, mail... and some others.

i've put this in my temporary fodel path:
'/home/myaccount/tmp'
drupal didn't give any errors when i save the settings.

what's interesting is that when i checked my hosting php's phpinfo(), i found that it have no value for:
upload_tmp_dir | no value | no value

i used your trick to set it:
ini_set('upload_tmp_dir', '/home/myaccount/tmp');

but i'm still out of luck!!! can anyone plz help me whats wrong.

fyi, i've just done clean install of drupal 4.6.1 and without touching any other modules, just trying to make uploading work.

i've found that ppl still didn't managed to resolve this issue.

waiting for reply,

// chall3ng3r //

vidyak’s picture

I was doing well with drupal 4.6.2, php4.4
i changed soem settings with the virtual hosting, but this has messed up the upload directory
This is really crazy, and frustrating
No difference if safe_mode is on or off
upload_tmp_dir is not set
Thanks
Vidya

HAZ’s picture

experienced exactly the same file=_0 error + "The uploaded file was not an image." when trying to upload images...

this is what fixed these problems for me:

System: Drupal 4.6.0 on IIS 6 with PHP 5 - full access to server (brand new installation of Drupal with NO modification to files etc...)

In PHP.ini

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = "C:\Inetpub\tmp"

Because I will eventually be working with large attachments:
upload_max_filesize = 200M
post_max_size = 200M
memory_limit = 200M
upload_tmp_dir = 200M
max_execution_time = 50000

Safe Mode = OFF

In Drupal >> Settings

Temporary directory:
C:\Inetpub\*site folder*\tmp

(On the Windows 2000 server I also set permissions for that folder to be writeable by everyone (via windows explorer)).

File system path:
files

Modules Enabled:
1. upload
2. image

Hope this helps someone out there!

--HAZ

watermelon’s picture

Iam reposting this again.
Please help!

-----------------

Hi,

Iam a newbie to drupal, just now installed.

I dont know how to use the default upload module in drupal. I have setted the configuration of upload module and enabled them.
How to give a page to upload and hook that to upload functionality? do i need to create a page in html to upload, then how to link the upload button to upload functionality. Or do i need to download some other module.

Need: I have to allow some users to upload images(gif and vsd) into the database or directories. And also allow them to view all the images.

If anyone could help me that will be great.

I greatly appreciate your help.

Thanks in advance,
watermelon

Gazard7’s picture

my system is Drupal 4.6.3 / IIS6 / PHP 5

In PHP.ini

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = "C:\Inetpub\tmp"

In Drupal >> Settings

File system path:
files

Temporary directory:
files\temp

Modules Enabled:
1. upload
2. image

Created tmp folder under inetpud and temp folder under drupal/files. Set permissions for those folders to be writeable by everyone.

It works! The key thing should be upload_tmp_dir setting in php.ini