Thread: [Arsperl-users] Attachment problems
Brought to you by:
jeffmurphy
|
From: Pittman, T. <Tim...@re...> - 2007-11-19 17:25:19
|
I am running ARSPerl 1.82 (I believe - is there a way to display or
check the version?) on a Windows 2000 server. My ARS system is version
6.00.01 running on an Oracle database on Redhat Enterprise Linux (Linux
2.4.9-e.57smp). I am using ARSPerl within a CGI web page to allow users
to attach documents to tickets that they are creating through this web
interface. I am using the following snippet of code to upload the
attachment file to the server...
my $root =3D 'C:\\Temp\\';
if ($upload_file1) {
$fh =3D $cgi->upload('upload_file1');
my ($name, $path, $suffix) =3D fileparse($upload_file1);
file1 =3D "$root$name";
open (OUT, ">>$file1") or die "\nCan't open $file1 for writing:
$!\n";
binmode $fh;
binmode OUT;
while (<$fh>) {
print OUT;
}
}=20
This code works fine and the files upload to the server into the c:\temp
directory. Then I use the following code to create the ticket and
attach the file to the ticket:
($entryId =3D ars_CreateEntry($ctrl, $shopSchema,=20
$sf{"Description"}, $summary,
$sf{"Requested By"}, $fullName,
...
Additional fields
...
$sf{"Additional Requirements"}, $addlreq,=20
$sf{"Submitter"}, $ID,
$sf{"Status"}, "Submitted"))=20
or print "\n<p>[ERROR]\tCould not add shop order due to
$ars_errstr<b><br>\n";
if ($entryId) {
if (defined($file1)) {
my $ret =3D ars_SetEntry($ctrl, $shopSchema, $entryId, 0,=20
$sf{'Document 1'}, {'file'=3D>$file1, size=3D>(-s $file1)});
if (!$ret) {
print "Error attaching file $file1. $ars_errstr<br>\n";
}
}
}
I have read several posts that said that attempting to create the
attachment along with the original ars_CreateEntry is not a good idea,
so I am using ars_SetEntry to put it on afterward.
Here's the problem -- it works sometimes, but other times the uploaded
file is corrupted and will not open using the Remedy client tool.
Typically we are uploading PDF files to attach to the tickets. When I
retrieve the file from the server's temp directory and open it, it
always works fine, but when I extract it from Remedy through the client
tool it is sometimes corrupt. It appears to be related to the file
itself as certain PDF files will save and retrieve consistently and
others will not. I haven't collected enough data to correlate it to
file size or type -- I just know it the ars_SetEntry action or something
from that point forward is corrupting the file.=20=20
Has anyone else encountered this situation or know of a way around it.=20
Thanks in advance,
Tim Pittman
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
CONFIDENTIALITY NOTICE
----------------------
This message, together with any attachments, may be legally privileged
and is confidential information intended only for the use of the
individual or entity to which it is addressed. It is exempt from
disclosure under applicable law including court orders. If you are not
the intended recipient, you are hereby notified that any use,
dissemination, distribution or copy of this message, or any attachment,
is strictly prohibited. If you have received this message in error,
please notify the original sender and delete this message, along with
any attachments, from your computer.
|
|
From: Richard H. <ric...@ho...> - 2007-11-19 19:08:18
|
Tim,
=20
Have you tried using ars_MergeEntry() to add the attachments? That's what I=
do and I've never seen it fail.
=20
Good Luck!
=20
Richard.
=20
> Date: Mon, 19 Nov 2007 12:08:46 -0500> From: Tim...@re...>=
To: ars...@ar...> Subject: [Arsperl-users] Attachment problem=
s> > I am running ARSPerl 1.82 (I believe - is there a way to display or> c=
heck the version?) on a Windows 2000 server. My ARS system is version> 6.00=
.01 running on an Oracle database on Redhat Enterprise Linux (Linux> 2.4.9-=
e.57smp). I am using ARSPerl within a CGI web page to allow users> to attac=
h documents to tickets that they are creating through this web> interface. =
I am using the following snippet of code to upload the> attachment file to =
the server...> > my $root =3D 'C:\\Temp\\';> if ($upload_file1) {> $fh =3D =
$cgi->upload('upload_file1');> my ($name, $path, $suffix) =3D fileparse($up=
load_file1);> file1 =3D "$root$name";> open (OUT, ">>$file1") or die "\nCan=
't open $file1 for writing:> $!\n";> binmode $fh;> binmode OUT;> while (<$f=
h>) {> print OUT;> }> } > > This code works fine and the files upload to th=
e server into the c:\temp> directory. Then I use the following code to crea=
te the ticket and> attach the file to the ticket:> > ($entryId =3D ars_Crea=
teEntry($ctrl, $shopSchema, > $sf{"Description"}, $summary,> $sf{"Requested=
By"}, $fullName,> ...> Additional fields> ...> $sf{"Additional Requirement=
s"}, $addlreq, > $sf{"Submitter"}, $ID,> $sf{"Status"}, "Submitted")) > or =
print "\n<p>[ERROR]\tCould not add shop order due to> $ars_errstr<b><br>\n"=
;> > if ($entryId) {> if (defined($file1)) {> my $ret =3D ars_SetEntry($ctr=
l, $shopSchema, $entryId, 0, > $sf{'Document 1'}, {'file'=3D>$file1, size=
=3D>(-s $file1)});> if (!$ret) {> print "Error attaching file $file1. $ars_=
errstr<br>\n";> }> }> }> > I have read several posts that said that attempt=
ing to create the> attachment along with the original ars_CreateEntry is no=
t a good idea,> so I am using ars_SetEntry to put it on afterward.> > Here'=
s the problem -- it works sometimes, but other times the uploaded> file is =
corrupted and will not open using the Remedy client tool.> Typically we are=
uploading PDF files to attach to the tickets. When I> retrieve the file fr=
om the server's temp directory and open it, it> always works fine, but when=
I extract it from Remedy through the client> tool it is sometimes corrupt.=
It appears to be related to the file> itself as certain PDF files will sav=
e and retrieve consistently and> others will not. I haven't collected enoug=
h data to correlate it to> file size or type -- I just know it the ars_SetE=
ntry action or something> from that point forward is corrupting the file. >=
> Has anyone else encountered this situation or know of a way around it. >=
> Thanks in advance,> Tim Pittman> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> CONFIDENTIALITY NOTICE> -------------------=
---> This message, together with any attachments, may be legally privileged=
> and is confidential information intended only for the use of the> individ=
ual or entity to which it is addressed. It is exempt from> disclosure under=
applicable law including court orders. If you are not> the intended recipi=
ent, you are hereby notified that any use,> dissemination, distribution or =
copy of this message, or any attachment,> is strictly prohibited. If you ha=
ve received this message in error,> please notify the original sender and d=
elete this message, along with> any attachments, from your computer.> > ---=
----------------------------------------------------------------------> Thi=
s SF.net email is sponsored by: Microsoft> Defy all challenges. Microsoft(R=
) Visual Studio 2005.> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/=
01/> _______________________________________________> Arsperl-users mailing=
list> Ars...@ar...> https://lists.sourceforge.net/lists/listi=
nfo/arsperl-users
_________________________________________________________________
100=92s of Music vouchers to be won with MSN Music
https://www.musicmashup.co.uk=
|
|
From: strauss <st...@re...> - 2007-11-20 22:44:22
|
Has anyone figured out how to get their ARSPerl CGI scripts to run against an ARS 7.1 server??? So far I have not found anything that works while editing my current production scripts against a 7.1 ITSM 7 server, and they already use Field ID instead of label or name so that's not it. I am seeing the same problems getting qualifications to run against ITSM 7 forms in Kinetic Calendar, so I am wondering if all of the plumbing has been moved beyond our reach in 7.1? =20 Christopher Strauss, Ph.D. Call Tracking Administration Manager University of North Texas Computing & IT Center http://itsm.unt.edu/=20 |
|
From: Thilo S. <thi...@ap...> - 2007-11-21 14:17:33
|
I didn't have any problems running ARSperl scripts (compiled for ARS 7.0 API) against an ARS 7.1 server. Can't say anything about ITSM 7, though. Do you get any kind of meaningful error message in $ars_errstr? strauss wrote: > Has anyone figured out how to get their ARSPerl CGI scripts to run > against an ARS 7.1 server??? So far I have not found anything that > works while editing my current production scripts against a 7.1 ITSM 7 > server, and they already use Field ID instead of label or name so that's > not it. I am seeing the same problems getting qualifications to run > against ITSM 7 forms in Kinetic Calendar, so I am wondering if all of > the plumbing has been moved beyond our reach in 7.1? > > > Christopher Strauss, Ph.D. > Call Tracking Administration Manager > University of North Texas Computing & IT Center > http://itsm.unt.edu/ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users |
|
From: strauss <st...@re...> - 2007-11-21 20:41:44
|
No specific errors, just not returning data where there is data that meets the qualifications. Seeing similar problem Kinetic where qualification should work but does not. BTW, I have ARSPerl 1.90 compiled with ARS 7.01 as distributed for Windows installation last June, using the ARS 7.0.01.003 dlls from ARSWiki, running on ActiveState Perl 5.8.8.819. Christopher Strauss, Ph.D. Call Tracking Administration Manager University of North Texas Computing & IT Center http://itsm.unt.edu/=20 > -----Original Message----- > From: ars...@ar...=20 > [mailto:ars...@ar...] On Behalf Of Thilo Stapff > Sent: Wednesday, November 21, 2007 8:17 AM > To: ARSperl User Discussion > Subject: Re: [Arsperl-users] ARSPerl scripts and ARS 7.1 >=20 > I didn't have any problems running ARSperl scripts (compiled=20 > for ARS 7.0 > API) against an ARS 7.1 server. > Can't say anything about ITSM 7, though. >=20 > Do you get any kind of meaningful error message in $ars_errstr? >=20 >=20 > strauss wrote: > > Has anyone figured out how to get their ARSPerl CGI scripts to run=20 > > against an ARS 7.1 server??? So far I have not found anything that=20 > > works while editing my current production scripts against a=20 > 7.1 ITSM 7=20 > > server, and they already use Field ID instead of label or name so=20 > > that's not it. I am seeing the same problems getting=20 > qualifications=20 > > to run against ITSM 7 forms in Kinetic Calendar, so I am=20 > wondering if=20 > > all of the plumbing has been moved beyond our reach in 7.1? > > =20 > >=20 > > Christopher Strauss, Ph.D. > > Call Tracking Administration Manager > > University of North Texas Computing & IT Center http://itsm.unt.edu/ > >=20 > >=20 > >=20 > ---------------------------------------------------------------------- > > -- > >=20 > >=20 > ---------------------------------------------------------------------- > > --- This SF.net email is sponsored by: Microsoft Defy all=20 > challenges.=20 > > Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > >=20 > >=20 > >=20 > ---------------------------------------------------------------------- > > -- > >=20 > > _______________________________________________ > > Arsperl-users mailing list > > Ars...@ar... > > https://lists.sourceforge.net/lists/listinfo/arsperl-users >=20 >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Microsoft Defy all=20 > challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users >=20 >=20 |
|
From: Thilo S. <thi...@ap...> - 2007-11-21 20:49:00
|
Could it be a permission problem? strauss wrote: > No specific errors, just not returning data where there is data that > meets the qualifications. Seeing similar problem Kinetic where > qualification should work but does not. > > BTW, I have ARSPerl 1.90 compiled with ARS 7.01 as distributed for > Windows installation last June, using the ARS 7.0.01.003 dlls from > ARSWiki, running on ActiveState Perl 5.8.8.819. > > Christopher Strauss, Ph.D. > Call Tracking Administration Manager > University of North Texas Computing & IT Center > http://itsm.unt.edu/ > >> -----Original Message----- >> From: ars...@ar... >> [mailto:ars...@ar...] On Behalf Of Thilo Stapff >> Sent: Wednesday, November 21, 2007 8:17 AM >> To: ARSperl User Discussion >> Subject: Re: [Arsperl-users] ARSPerl scripts and ARS 7.1 >> >> I didn't have any problems running ARSperl scripts (compiled >> for ARS 7.0 >> API) against an ARS 7.1 server. >> Can't say anything about ITSM 7, though. >> >> Do you get any kind of meaningful error message in $ars_errstr? >> >> >> strauss wrote: >>> Has anyone figured out how to get their ARSPerl CGI scripts to run >>> against an ARS 7.1 server??? So far I have not found anything that >>> works while editing my current production scripts against a >> 7.1 ITSM 7 >>> server, and they already use Field ID instead of label or name so >>> that's not it. I am seeing the same problems getting >> qualifications >>> to run against ITSM 7 forms in Kinetic Calendar, so I am >> wondering if >>> all of the plumbing has been moved beyond our reach in 7.1? >>> >>> >>> Christopher Strauss, Ph.D. >>> Call Tracking Administration Manager >>> University of North Texas Computing & IT Center http://itsm.unt.edu/ >>> >>> >>> >> ---------------------------------------------------------------------- >>> -- >>> >>> >> ---------------------------------------------------------------------- >>> --- This SF.net email is sponsored by: Microsoft Defy all >> challenges. >>> Microsoft(R) Visual Studio 2005. >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>> >>> >>> >> ---------------------------------------------------------------------- >>> -- >>> >>> _______________________________________________ >>> Arsperl-users mailing list >>> Ars...@ar... >>> https://lists.sourceforge.net/lists/listinfo/arsperl-users >> >> -------------------------------------------------------------- >> ----------- >> This SF.net email is sponsored by: Microsoft Defy all >> challenges. Microsoft(R) Visual Studio 2005. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Arsperl-users mailing list >> Ars...@ar... >> https://lists.sourceforge.net/lists/listinfo/arsperl-users >> >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users > |
|
From: Joseph K. <jos...@gm...> - 2007-11-21 17:11:32
|
I have not done extensive testing, but I have not yet run into any problems running ARSPerl 1.90 against our 7.1 development server. I compiled it against the 7.0 API ( version 9 according to ars_APIVersion ). Joe On Nov 20, 2007 5:32 PM, strauss <st...@re...> wrote: > > > Has anyone figured out how to get their ARSPerl CGI scripts to run against > an ARS 7.1 server??? So far I have not found anything that works while > editing my current production scripts against a 7.1 ITSM 7 server, and they > already use Field ID instead of label or name so that's not it. I am seeing > the same problems getting qualifications to run against ITSM 7 forms in > Kinetic Calendar, so I am wondering if all of the plumbing has been moved > beyond our reach in 7.1? > > > Christopher Strauss, Ph.D. > Call Tracking Administration Manager > University of North Texas Computing & IT Center > http://itsm.unt.edu/ > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Arsperl-users mailing list > Ars...@ar... > https://lists.sourceforge.net/lists/listinfo/arsperl-users > > |