[AOLSERVER] file upload corrupts jpg images
I have two servers running: one is aolserver 3.4.2; the other is aolserver 3.5.0. I have a simple form that allows me to upload a file to my server. I want to upload a jpg image. The code works fine on the 3.4.2 server. However, when I run the script on the 3.5.0 server, the image that is uploaded is corrupted. The code that does the work of uploading the file is as follows: --- set target_directory /WWW_pages/server2/pages/images/udm_images/ set targetfile [ns_queryget file_name] set temploc [ns_queryget file_name.tmpfile] set targetfile [strip_leading_path $targetfile] # force extension to lower case regsub {.JPG} $targetfile .jpg targetfile regsub {.GIF} $targetfile .gif targetfile regsub {.DOC} $targetfile .doc targetfile regsub {.CSV} $targetfile .csv targetfile set target $target_directory$targetfile ns_cp $temploc $target --- The function strip_leading_path does just that - returning the file name. The nsd.tcl files for the two servers are identical except that caching is enabled on the 3.5.0 server. I am stumped. Best regards, Thorpe -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] file upload corrupts jpg images
This is a follow-up to my initial post. I replaced aolserver3.5.0 with 3.5.1, as was suggested in an earlier post. No change. Thorpe -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] file upload corrupts jpg image
This is yet another follow-up. I installed aolserver 3.5.6. The problem persists. Thorpe -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.
Re: [AOLSERVER] file upload corrupts jpg images
You might try Tcl's file copy command instead of ns_cp. (It also sounds like strip_leading_path might be replaceable with file tail.) Have you determined if the file is being corrupted before or after it is moved from its temporary location? What platform is this? On Sun, 8 Aug 2004 19:41:26 -0400, Thorpe Mayes [EMAIL PROTECTED] wrote: I have two servers running: one is aolserver 3.4.2; the other is aolserver 3.5.0. I have a simple form that allows me to upload a file to my server. I want to upload a jpg image. The code works fine on the 3.4.2 server. However, when I run the script on the 3.5.0 server, the image that is uploaded is corrupted. The code that does the work of uploading the file is as follows: --- set target_directory /WWW_pages/server2/pages/images/udm_images/ set targetfile [ns_queryget file_name] set temploc [ns_queryget file_name.tmpfile] set targetfile [strip_leading_path $targetfile] # force extension to lower case regsub {.JPG} $targetfile .jpg targetfile regsub {.GIF} $targetfile .gif targetfile regsub {.DOC} $targetfile .doc targetfile regsub {.CSV} $targetfile .csv targetfile set target $target_directory$targetfile ns_cp $temploc $target --- The function strip_leading_path does just that - returning the file name. The nsd.tcl files for the two servers are identical except that caching is enabled on the 3.5.0 server. I am stumped. Best regards, Thorpe -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank. -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to [EMAIL PROTECTED] with the body of SIGNOFF AOLSERVER in the email message. You can leave the Subject: field of your email blank.