[imp] Can't upload attachments SOLVED

Daniel A. Ramaley daniel.ramaley at DRAKE.EDU
Tue Dec 13 13:45:11 PST 2005


On Tuesday 13 December 2005 15:28, Daniel A. Ramaley wrote:
>On Friday 09 December 2005 13:18, Daniel A. Ramaley wrote:
>>Hello. I am running Horde 3.0.7 with Imp 4.0.4 on a Linux server with
>>Apache 2.0.52 and PHP 4.3.9. I can send messages just fine, except if
>> i try to include an attachment. To attach a file, i scroll to the
>> bottom of the compose page, hit "Browse...", select a file from the
>> open dialog, then hit "Attach" back in the compose page. With
>> Firefox (on either Windows or Linux), hitting Attach does nothing.
>> With Internet Explorer on Windows when i hit Attach, the status bar
>> displays "Error on page." (but doesn't say what the error is). Any
>> ideas? I'm not using a proxy that modifies content, and javascript
>> is enabled in the browsers that i've tested.
>>
>>In my php.ini the following relevant values are set:
>>    file_uploads = On
>>    upload_tmp_dir = /var/tmp
>>    upload_max_filesize = 5M
>>    post_max_size = 8M
>>The file i'm attempting to upload is about 300kB, so it shouldn't be
>>even close to hitting the limits. Based on Internet Explorer's
>> message, i'm guessing it is a javascript problem. Are there any
>> known javascript errors with file uploads?
>
>I have some more information to add regarding this problem. I opened
> the JavaScript Console (in Firefox) and then tried adding an
> attachment again. An error is recorded in the Console when i hit
> attach:
>
>  Error: document.compose.submitBtn2 has no properties
>  Source File:
> http://sun12.drake.edu/imp/compose.php?thismailbox=INBOX Line: 132
>
>Line 132 is the submitBtn2 line in this function:
>
>function uniqSubmit()
>{
>    now = new Date();
>    document.compose.submitBtn1.disabled = true;
>    document.compose.submitBtn2.disabled = true;
>    document.compose.submitBtn3.disabled = true;
>    document.compose.submitBtn4.disabled = true;
>    document.compose.submitBtn5.disabled = true;
>    document.compose.submitBtn6.disabled = true;
>    document.compose.submitBtn7.disabled = true;
>    if (document.compose.style && document.compose.style.cursor) {
>        document.compose.style.cursor = "wait";
>    }
>    document.compose.submit();
>}
>
>I don't know exactly what this is supposed to do since i've not worked
>with JavaScript before. Would it be safe just to remove the offending
>line? Or are there any other suggestions on how to fix the problem?
>
>I'm not very familiar with Internet Explorer, but did find a more
>detailed error on the page. Internet Explorer's version of the error
>is:
>
>Line: 141
>Char: 5
>Error: 'document.compose.submitBtn2' is null or not an object
>Code: 0
>URL: http://sun12.drake.edu/imp/compose.php?thismailbox=INBOX
>
>I'm not sure why the line number is so different, but viewing source
> and going to line 141 shows it to be the same line in uniqSubmit that
> Firefox choked on.
>
>A few searches of the page source for "submitBtn#" (where # is a digit
>1-7) indicate that submitBtn2 and submitBtn5 each only occur once in
>the source, both in the uniqSubmit function. The other submitBtn#
> occur twice each, once in uniqSubmit and once elsewhere. Are
> submitBtn2 and submitBtn5 supposed to occur elsewhere in the source?
> What would cause them to be removed?

Sorry for replying to my own messages again, but i've finally tracked 
down the problem. In the Horde installation that i'm working with, 
we've removed the ability to save drafts by editing 
templates/compose/compose.inc in our Imp installation and adding "false 
and" to the conditionals that surround the Save Draft links. I needed 
to also edit templates/compose/compose.js and make the same changes. 
Now that that is done, attachments work perfectly.

Thanks for your time and i apologize for cluttering the list.

------------------------------------------------------------------------
Dan Ramaley
Network Programmer/Analyst
(515) 271-4540
Dial Center 118, Drake University


More information about the imp mailing list