UPLOADINTOSTREAM
bruno77
Member Posts: 62
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.
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
-
For DOWNLOAD If you set the foldername to '<TEMP>' it should download the file to the TEMP directory without asking.
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.Freddy Kristiansen
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.0 -
Thanks for the reply however unfortunatley that didn't work

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.0 -
Correct, the up/download are for 3T and doesn't work on classic.
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).
/FreddyFreddy Kristiansen
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.0 -
Hi Freddy,
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!
/bruno0 -
Hi.
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 box0 -
Hi Stig
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 helpBig D signing off!0 -
Hello everyone,
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
NicoleProTAKT Projekte & Business Software AG
Microsoft Dynamics NAV Partner
Bad Nauheim, Germany
http://www.protakt.de
http://twitter.com/protakt0 -
After some testing i finally get it to work.
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('');
END0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
