Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts

Friday, March 23, 2012

FileUpload

I have gotten FileUpload in VB.Net to work fine in saving a file to a web server folder but cannot find some examples on how to save the file as an image on sql200. Can anyone point me in the write direction - thanks.

Please refer to this article, which contains a sample about how to deal with BLOB data in SQL Server:
http://forums.asp.net/thread/1254026.aspx

|||

i dont like it, but i figured it out and have written about in my blog

http://weblogs.asp.net/hpreishuber/archive/2006/02/17/438498.aspx

|||

string fileName = FileUpload1.PostedFile.FileName;

byte[] lc_ByteFile = new byte[FileUpload1.FileContent.Length];

lc_ByteFile = ReadFileToByteArray(fileName, FileUpload1.FileContent.Length);

if (FileUpload1.FileName.EndsWith(".jpg") || FileUpload1.FileName.EndsWith(".jpeg") || FileUpload1.FileName.EndsWith(".gif") || FileUpload1.FileName.EndsWith(".bmp"))

{

System.Drawing.Image newImage;

MemoryStream stream = new MemoryStream(lc_ByteFile);

newImage = System.Drawing.Image.FromStream(stream);

newImage.Save("D:\\NewImage.bmp");

}

Try this out it works

Friday, March 9, 2012

File Watcher Task doesnt wait for the entire file to be completely finish before it completes

Hey there

Ive built an SSIS package which generates a file from a legacy system and then downloads the file into a designated folder on the server. I need the file watcher task to wait for a the file to completely finish loading before it says it is complete. Currently, as soon as the file is created, the WMI step finishes.

Any help would be greatly appreciated!

Kind Regards

David

Check out http://www.sqlis.com/default.aspx?23

Thanks,
Loonysan

|||

Hi

Thanks for that. We decided to take a different approach though.

Ive downloaded another file watcher task from Konesans. Konesans.Dts.FilewatcherTask.FileWatcherTask. I have added it into my SSIS package and it is working like a dream!

However, when to Add it to the SQL Server Agent, I get a strange error message (Package Execution Progress):

- -> Wait for File to Download

Validation has started

Error: The task has failed to load. The contact information for this task is "".

Error: There were errors during the task validation

Validation is completed

Any ideas of how to resolve this?

Thanking you in advance

David

|||

Konesans file watcher is the same one as http://www.sqlis.com/default.aspx?23

Please check if this component is installed in the machine where you are trying to execute the package via SQL Agent. It looks like the SSIS Package is not able to load the FileWatcher Task at runtime.

If the problem persists - contact http://www.konesans.com/contact.aspx

Thanks,
Loonysan

File Watcher Task doesnt wait for the entire file to be completely finish before it complete

Hey there

Ive built an SSIS package which generates a file from a legacy system and then downloads the file into a designated folder on the server. I need the file watcher task to wait for a the file to completely finish loading before it says it is complete. Currently, as soon as the file is created, the WMI step finishes.

Any help would be greatly appreciated!

Kind Regards

David

Check out http://www.sqlis.com/default.aspx?23

Thanks,
Loonysan

|||

Hi

Thanks for that. We decided to take a different approach though.

Ive downloaded another file watcher task from Konesans. Konesans.Dts.FilewatcherTask.FileWatcherTask. I have added it into my SSIS package and it is working like a dream!

However, when to Add it to the SQL Server Agent, I get a strange error message (Package Execution Progress):

- -> Wait for File to Download

Validation has started

Error: The task has failed to load. The contact information for this task is "".

Error: There were errors during the task validation

Validation is completed

Any ideas of how to resolve this?

Thanking you in advance

David

|||

Konesans file watcher is the same one as http://www.sqlis.com/default.aspx?23

Please check if this component is installed in the machine where you are trying to execute the package via SQL Agent. It looks like the SSIS Package is not able to load the FileWatcher Task at runtime.

If the problem persists - contact http://www.konesans.com/contact.aspx

Thanks,
Loonysan

Wednesday, March 7, 2012

file system task - Problem

I am using file system task for deletion of text file from a specified folder.

but i want that one text file with name ="ssis.txt" and "ssrs.txt "should not get delete.

Is there any option or any expression that we can set and avoide the deletion of ssis.txt and ssrs.txt and still delete all the remaining all text file from a folder.

Please suggest any method or expression by example.

Sounds like a job for a ForEach loop containing the FileSystem operation, and some task (.Net script?) that compares the file name for the specific iteration of the ForEach loop with the protected tables list, and determines whether to call to File Delete
|||

I just wish to use the file system task and perform this.

Cannt we use some expression infile system task and disable the deletion for say 2 files and let the deletion happen for other remaining files.

|||Possibly - I'm not sure. I haven't seen a way to do it...

File System Task - How to Move Directory Contents

Hi,

I want to move all files of one directory/folder into another usng SSIS, like in DOS Prompt we use the command,

Move d:\ftpSource\*.* d:\ETLSource

I have tried by creating a file system task, but there is no option for Move Directory Contents. Move File is not accepting wild cards.

Regards,

Imran.

Hi,

U can use 'move directory'. But both source and destination should have same root and if the destination folder already exists. Also it will work as a rename folder. So either the destination folder should not exist or u should set the 'overwrite destination' property to true which will delete the destination folder before renaming the source. U better do it thru 'File' object in Script task.

|||

Imran Shaikh wrote:

Hi,

I want to move all files of one directory/folder into another usng SSIS, like in DOS Prompt we use the command,

Move d:\ftpSource\*.* d:\ETLSource

I have tried by creating a file system task, but there is no option

for Move Directory Contents. Move File is not accepting wild cards.

Regards,

Imran.

I struggled with this myself, and in the end I had to do 2 file system operations:

(1) copy directory - from source to destination

(2) delete directory contents - from source

HTH|||

Hi,

Sorry I cant move directory, because it is published over ftp. The way I already have done is (foreach loop over directory...Move file), but it is slow. Thanks for the hint, Now I will try file Object in Script task.

Thanks

Imran.

File System Access With Custom Assembly Method

Hello All,
I am building a dashboard report that will read through the file system
for a record's document folder on our server and report to the user if
there are any files missing in the directory. I am using a custom
assembly to house the method. When using the assembly in the dev
environment, everything works just fine. When the report is deployed
to the server, the assembly seems to work fine, but on closer
inspection, it looks like I cannot read the file system. Can someone
point me to a link that can bypass this (safely)? Do I need to suck it
up and create an ASP.NET app that does the same thing?
Thanks
JeffHi Jeff.
You need to change the "rssrvpolicy.config" to permit file access to your
assembly. In Visual Studio you have all permissions, but running on the
report server permission checks is performed.
In "rssrvpolicy.config" you can see several codegroups giving other
assemblies certain permissions. The file is found in "%SQL
SERVER%\MSSQL\Reporting Services\ReportServer"
You can put you CodeGroup below the one ending with Url="$CodeGen$/*". Se
sample:
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="$CodeGen$/*"
/>
</CodeGroup>
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyCodeGroup"
Description="Code group for my assembly">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer\bin\MyAssembly.MyNamespace.MyClass.dll"
/>
</CodeGroup>
This way you give you assemmbly Full thrust. To limit persmission to file
access you can change PermissionSet to "FileIOPermission".
Kind regards
Martin Bring (Sogeti AB)
*****************
"jeffjones176@.gmail.com" wrote:
> Hello All,
> I am building a dashboard report that will read through the file system
> for a record's document folder on our server and report to the user if
> there are any files missing in the directory. I am using a custom
> assembly to house the method. When using the assembly in the dev
> environment, everything works just fine. When the report is deployed
> to the server, the assembly seems to work fine, but on closer
> inspection, it looks like I cannot read the file system. Can someone
> point me to a link that can bypass this (safely)? Do I need to suck it
> up and create an ASP.NET app that does the same thing?
> Thanks
> Jeff
>

Sunday, February 26, 2012

File share delivery

Hi All,
I am new to SQL 2005 Reporting Services. I have done the reports and now I
want to publish them to a folder in then local machine. I even tried that. I
created a subscription and when it is to rum gives an error "Unable to write
file <abc>, Report Server Configuration error, see log files for more
details". I am not able to understand the problem. Can any one of you please
help me what to do in this and get my problem sorted.
ThanksRajeev,
1. What does the log say? Did you look?
2. Did you specify a UNC path to the folder?
3. Did the user you set up for the subscription have rights to the folder?
--
Andy Potter
blog: http://sqlreportingservices.spaces.live.com/
"Rajeev" wrote:
> Hi All,
> I am new to SQL 2005 Reporting Services. I have done the reports and now I
> want to publish them to a folder in then local machine. I even tried that. I
> created a subscription and when it is to rum gives an error "Unable to write
> file <abc>, Report Server Configuration error, see log files for more
> details". I am not able to understand the problem. Can any one of you please
> help me what to do in this and get my problem sorted.
> Thanks|||Hi,
I think Your folder which contains report files having Readonly. Check it
out by opening Properties of folder and uncheck read only box
"Rajeev" wrote:
> Hi All,
> I am new to SQL 2005 Reporting Services. I have done the reports and now I
> want to publish them to a folder in then local machine. I even tried that. I
> created a subscription and when it is to rum gives an error "Unable to write
> file <abc>, Report Server Configuration error, see log files for more
> details". I am not able to understand the problem. Can any one of you please
> help me what to do in this and get my problem sorted.
> Thanks

file share

hi
i do not get any errors, but i do not see my reports in the shared folder.
here is my configuraiton table
title ext folder render username pwd write
param1 param2
19051, pdf, \\sqlrpt2\krbi ,NULL ,kr_net\pfuller, rewt, NULL, 19051 ,
12/31/2005
18629 ,pdf ,\\sqlrpt2\krbi ,NULL, kr_net\pfuller ,rewt , NULL , 18629 ,
12/31/2005
writemode is static at overwrite
render is static at acrobati have some more informatino.
here is the log message...
"eportingServicesService!crypto!178c!02/01/2006-16:09:04:: e ERROR:
DBUnProtectData failed: System.FormatException: Invalid character in a
Base-64 string.
at System.Convert.FromBase64String(String s)
at
Microsoft.ReportingServices.Diagnostics.DataProtection.DBUnprotectData(String
data)
ReportingServicesService!crypto!178c!02/01/2006-16:09:04:: i INFO: Current
user: NT AUTHORITY\NETWORK SERVICE
ReportingServicesService!notification!178c!02/01/2006-16:09:04:: e ERROR:
Error occured processing notification. Invalid character in a Base-64
string.
ReportingServicesService!library!178c!02/01/2006-16:09:04:: Data Driven
Notification for activation id ddbec942-54ac-4709-b7f9-3bc73952f662 was
saved.
ReportingServicesService!library!178c!02/01/2006-16:09:04:: Status: Invalid
character in a Base-64 string.
"
"Pete Fuller" <pfuller@.kirbyrisk.com> wrote in message
news:ekaFpY0JGHA.3144@.TK2MSFTNGP11.phx.gbl...
> hi
> i do not get any errors, but i do not see my reports in the shared folder.
> here is my configuraiton table
> title ext folder render username pwd write
> param1 param2
> 19051, pdf, \\sqlrpt2\krbi ,NULL ,kr_net\pfuller, rewt, NULL, 19051 ,
> 12/31/2005
> 18629 ,pdf ,\\sqlrpt2\krbi ,NULL, kr_net\pfuller ,rewt , NULL , 18629 ,
> 12/31/2005
> writemode is static at overwrite
> render is static at acrobat
>