Hi,
Does anyone know if the UPLOADINTOSTREAM or UPLOAD functions can be used without displaying the dialog box, in the same way as was possible with the previous IMPORT function:
[ImportName] := Blob.IMPORT([Name [, CommonDialog]])
CommonDialog - Type: Boolean
Specifies whether you want to display a dialog box before the BLOB is imported.
Thanks in advance.
0
Comments
I am pretty sure that this is true for upload as well - set the foldername to <TEMP> and specify a filename in the Temp directory for upload. If this doesn't work - maybe try to leave foldername blank and have filename contain a fully qualified filename in the temp directory - that should work.
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
UPLOADINTOSTREAM('','','',filename,inStr);
RTC still displays the dialog and the code is ignored by the Classic client.
In addition I found that the following code works in the Classic as expected but is ignored by the RTC:
Xml.CREATEINSTREAM(_inStr);
XMLDocIn.save(_inStr);
Where XMLDocIn is 'Microsoft XML, v3.0'.DOMDocument and XML is a BLOB field work on the Classic client but not the RTC, any ideas on that one?
Thanks in advance.
Bruno
http://blogs.ittoolbox.com/erp/smb
reg your XML question - stream is unsupported in automation on 3T.
reg. your UPLOAD - did you put your file in your temp directory (TEMP=C:\Users\<user>\AppData\Local\Temp) and include that in your filename?
(I didn't have time to try myself - I just read a spec).
/Freddy
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
Just got back working on this issue. Using <TEMP> (or the 3-Tier Automation Mgt.MagicPath function) as you suggested works as expect, the dialog is not longer display . Thanks a for that!
Still can't get the file to upload into my BLOB field though, always getting the error: file not found. All my code is executed on the service tier. I have tried saving the xmlDom to several folders (also tried using the 3-Tier Automation Mgt.EnvironFileName function) but still get the same file not found error, see below for my sample code:
Xml.CREATEINSTREAM(inStr);
filename := 'c:\temp\file.xml'; //threeTier.EnvironFileName('file','xml');
XMLDocIn.save(filename);
UPLOADINTOSTREAM('',threeTier.Magicpath,'',filename,inStr);
Any ideas on what I am missing?
Also, not sure why streams are not supported in the service tier, why is that? Seems like a pretty big step backwards having to work with files again, versus memory streams, also it is less efficient. Will support for streams be added back soon?
Thanks again, and I appreciate your help on this!
/bruno
Bruno
http://blogs.ittoolbox.com/erp/smb
Just wondering, can you post the code that works with <Temp>. I have tryed everything said in this post, but i still get the Dialog box
Hope you're well!
Did you get an answer to this one in the end or work it out yourself?
I've incorporated the standard code in CU419...
BLOBImport(VAR BLOBRef : TEMPORARY Record TempBlob;Name : Text[1024];CommonDialog : Boolean) : Text[1024]
IF NOT ISSERVICETIER THEN BEGIN
IF CommonDialog THEN BEGIN
Name := CommonDialogMgnt.OpenFileWithName(Name);
IF STRPOS(Name,'*') > 0 THEN
EXIT('');
END;
BLOBRef.Blob.IMPORT(Name,FALSE);
EXIT(Name);
END
ELSE BEGIN
// IF UPLOADINTOSTREAM(Text007,'',Text009,Name,NVInStream) THEN BEGIN
IF UPLOADINTOSTREAM(Text007,Magicpath,Text009,Name,NVInStream) THEN BEGIN //Magicpath
BLOBRef.Blob.CREATEOUTSTREAM(NVOutStream);
COPYSTREAM(NVOutStream,NVInStream);
EXIT(Name);
END;
EXIT('');
END
Added the Magicpath and as the other people had said in this forum it doesn't ask for the name and path in a standard dialogue box - great But the file it has saved is not the correct file - ouch ](*,) ! The Name part in the call UPLOADINTOSTREAM function has the right name and path - so is there a way to force this filename without a further dialog box?
Thanks if you can help
I am quite sure you got this one solved by now:
Xml.CREATEINSTREAM(inStr);
filename := 'c:\temp\file.xml'; //threeTier.EnvironFileName('file','xml');
XMLDocIn.save(filename);
UPLOADINTOSTREAM('',threeTier.Magicpath,'',filename,inStr);
Could someone please help me out since I just can't figure it out to make it work?! ](*,)
Would be really nice!
Thanks in adance!
Regards
Nicole
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt
I modified the BlobImport Function in 3-Tier Mgt Codeunit as follows :
FSO Automation 'Windows Script Host Object Model'.FileSystemObject
FromFile Text 1024
NewTempName Text 1024
Path Text 1024
IF NOT ISSERVICETIER THEN BEGIN
IF CommonDialog THEN BEGIN
Name := CommonDialogMgnt.OpenFileWithName(Name);
IF STRPOS(Name,'*') > 0 THEN
EXIT('');
END;
BLOBRef.Blob.IMPORT(Name,FALSE);
EXIT(Name);
END
ELSE BEGIN
Path := '';
FromFile := Name;
IF NOT CommonDialog THEN BEGIN
Path := Magicpath;
CREATE(FSO,FALSE,TRUE);
FromFile := FSO.GetFileName(FromFile);
NewTempName := ClientTempFileName(FromFile,FSO.GetExtensionName(FromFile));
FSO.CopyFile(Name,NewTempName);
Name := NewTempName;
END;
IF UPLOADINTOSTREAM(Text007,Path,Text009,Name,NVInStream) THEN BEGIN
BLOBRef.Blob.CREATEOUTSTREAM(NVOutStream);
COPYSTREAM(NVOutStream,NVInStream);
EXIT(FromFile);
END;
EXIT('');
END