Page 1 of 1

Upload file other than image

Posted: Fri Dec 15, 2006 1:11 pm
by Amon Tse
Is there any way to allow uploading a non-image file? What I wish is to upload a e.g. Word document, and provide a hyperlink in an entry for the reader to download the file. Many thanks first for your help in advance.

Posted: Fri Dec 15, 2006 1:12 pm
by d_cee
Hi

the simplest way I guess would be to install the download mangaer plugin and link to the file from your entry.

HTH

Dave

Posted: Fri Dec 15, 2006 3:13 pm
by judebert
I routinely use the media manager in 1.0.4 to upload non-image files (mostly zips and tarballs). You can then use the Media button when editing an entry to insert a link to the downloadable file.

The only problem would be if your server isn't configured to recognize the file type as downloadable, and tried to display it. This has occured for me with Palm PRC files, for instance. In that case, I just zipped it up.

Posted: Fri Dec 15, 2006 6:28 pm
by Amon Tse
Thanks Dave. But unluckily I am unable to download the Download Manager due to server timeout. I shall try it later.

Thanks Judebert. I have tried to upload a Word doc, filename likes xxx.doc, but the upload fails. [Remark: I have tried to upload a gif file and it works.] Do you think there is any restriction on the filename? Or is it some configuration issue?

Thanks again for your advices first.

Posted: Fri Dec 15, 2006 8:39 pm
by judebert
More likely it's a restriction on the size of uploads or memory space. Check your Serendipity configuration to find the max upload size; it defaults to 4M in older versions and 10M in the latest 1.1 beta.

The webserver also restricts your upload size. That's set in the php.ini, and it's often a very small value. For that, though, you'd need to check with your server admin.

Try uploading a jpg or gif as big as your Word document. Does it still work?

Posted: Sun Dec 17, 2006 10:11 am
by Amon Tse
Thanks Judebert! It seems the problem in file size limit.
I have tried to upload a 19K doc file and sucessful. However, I am unable to upload a 768K doc file. Then I zip the file into 104 K and upload is OK.

I still can remember during the configurtion the upload and post limit is 8M. I have checked in php.ini and the setting is 8M.

I would like to check the configuration file of serendipity, but however I don't know the configuration in which the setting is located.

I am using serendipity 1.0.4 (latest) and apache. Would you please provide some hint for me? Many thanks.

Posted: Sun Dec 17, 2006 5:45 pm
by chickens
Since you can not upload a file of 1mb I would guess that either apache or php is the limiting factor. My guess that something is limiting the amount of time for the upload more than the size. If you have root access to your server you can look at the settings below, otherwise talk to your host about this.

CAUTION: These settings may cause problems with other scripts that are not designed properly. I suggest looking at the apache and php manual prior to changing any of these settings.

httpd.conf

Code: Select all

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

php.ini

Code: Select all

max_execution_time = 30     ; Maximum execution time of each script, in seconds
memory_limit = 8M           ; Maximum amount of memory a script may consume (8MB)

Code: Select all

post_max_size       =   55M     ; Maximum size of POST data that PHP will accept.

Code: Select all

upload_max_filesize = 2000M         ; Maximum allowed size for uploaded files
I had a timeout issue previously when uploading large videos (around 8mb) and these settings allow it to work. The big setting here is in the apache config file more than php as it is the one accepting the file before sending it to php to parse it.

Please note that I am on a server which I have complete control over. I do not recommend setting these so high for a shared host as someone could kill the server.