News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Problem with attachments /w server in CGI-mode?

Started by jpuhakka, November 04, 2004, 08:03:01 PM

Previous topic - Next topic

jpuhakka

So.. hello there.. let me explain my problem, and view my analysis, i have no idea why this is happening, nor what is going wrong..

1) I have my local copy of forum (SMF RC2, converted from YABB), it works fine with same files as in CGI-moded online-forum, BUT online forum ain't working..

it has problems with attachments and avatars.. this is not 'bout privileges, because i have double-double-checked em, also directories are fine, i observed following behavior.. i have "hide-filenames-option is enabled" and so, here is an example: file "etu.jpg" is uploaded it is being saved into attachment directory and renamed to "190_etu_jpg532c0cc1c82c859f9ad4f0e306488919".

when i try opening direct link "index.php?action=dlattach;topic=169.0;id=190" (this shows in IE, window that it is bout to receive JPEG image, when opened in viewer, it only displays unknown image), avatars instead just display whitebox with red cross (= no image found, while opera does not display anything) (It works local, not online, also, local copy does not ask to save file..)

- File is being uploaded correctly to server (because when i try to open "190_etu_jpg..." file it opens correctly,
but trough smf using dlattach link, it shows above "unknown image"..

well, i'm a coder and i tried to figure this problem out, and  here is some "maybe not-so-important" debug-information:

- file is obviously corrupted, first i thought, that server has some problems with mime or something and tried to download file in ASCII, homever, this was not the case, i tried binary repairer, without no luck, image still opens garbled / unknown file..

then i loaded a file saved from attachments directory and file saved trough SMF, to an hex editor, and did binary compare to them (i did 3x original x altered compare) and these same results come up:

FPOS DATA
0000 3632 630D 0A                                                                   
062C 0D0A 3562 350D 0A
0BE1 0D0A 3562 360D 0A
1197 0D0A 3562 360D 0A
174D 0D0A 3562 360D 0A
1D03 0D0A 3562 300D 0A
22B3 0D0A 3562 360D 0A
.. and so on, and so on..

first column is fileposition (in hex), and rest 5 hexes are actual data..

it seems, that for some unknown reason, SMF / server?, insert this almost same data with 1400-2000 bytes interval)
and like pros see, that, there is some familiar hexes in output, 0Dh & 0Ah, and line transforms to:
Line Feed+Carriage Return+35h+62h+$$+linefeed+carriage return

and now the questions:

- what you think, how i could fix this problem, when we know the error? (this isn't bug?)
- which source file i have to edit to filter this stuff out?
- what you think does this have something to do with magic_quotes?, it's set to "0" in server..

i hope i explained problem clearly enough (and gived enough details bout problem), help if you can.. meanwhile i keep trying to pinpoint the problem.

ps. When we did use YABB, attachments and avatars worked fine.. (also runned it in CGI mode), so i believe this problem is in code.. and hope that above helps to locate it? (i believe that persons that did download() part of SMF code, could help?)

pps. i created filefixer, which parses above binary from broken file, and after fixing (removingphony data?) from file it started working correctly. (and binary checks passed as well).. so.. i just dont get it.. where is the glitch ???

[Unknown]

This has nothing to do with magic_quotes, nor with CGI.  Attachments work fine in both conditions.

Please give me a link and, if necessary, a test account.

-[Unknown]

jpuhakka

#2
you have private message with necessary account/links

[Unknown]

You're using an old version of PHP.  I'm afraid attachments may not work properly with 4.1.2 unless "compressed output" is off.

-[Unknown]

jpuhakka

#4
well, what did you know, i changed settings, and it worked.. unbeliavable.. thanks.. :o 8)
now all 1500+ users will be happy again ;D

so was problem was a kind of server related?

(i previously tested some other options under attachemnts etc, but i had never in mind to try switching compressed output off..) i believe that this compressed output setting was automatically enabled when updated from yabb?

and sorry if this topic is repost and has been discussed before in forum (i did try to search)..
and admins may delete this post also if answered before..

Advertisement: