Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 SSIS C# Zip Files
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cipriani1984
Constraint Violating Yak Guru

United Kingdom
304 Posts

Posted - 01/13/2014 :  13:00:51  Show Profile  Click to see cipriani1984's MSN Messenger address  Reply with Quote
Hi,

I have an ssis package, that traverses through loads of folders and returns paths to all the zip files inside them.

I can then read inside the zip file and return all the names of the csv's inside them, and when i pass the name of the csv's so \\networkpath\folder\subfolder\file.zip\numbers.csv

it complains the path does not exist even though when I copy and paste the path onto file explorer it opens fine.

Many thanks in advance.

copy of my code below:

FileInputStream fis = new FileInputStream(zipFilePath);
ZipInputStream zis = new ZipInputStream(fis);
ZipEntry ze;

//Loop through all files in the zip file
while ((ze = zis.getNextEntry()) != null)
{
//File name format in zip file is:
String filename = ze.getName();
String newname = filename;
newname = newname.Replace("/", @"\");
//Full filename and path
String fullfilename = zipFilePath + @"\" + newname;

FileInfo fileinfo;

fileinfo = new FileInfo(filename);

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 01/13/2014 :  14:14:13  Show Profile  Reply with Quote
is the package executed from the same machine?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

United Kingdom
304 Posts

Posted - 01/14/2014 :  04:07:45  Show Profile  Click to see cipriani1984's MSN Messenger address  Reply with Quote
The folders are on different server, i was thinking of looking at aspnet permissions, but any other suggestions too?

thanks

quote:
Originally posted by visakh16

is the package executed from the same machine?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 01/14/2014 :  04:23:07  Show Profile  Reply with Quote
quote:
Originally posted by cipriani1984

The folders are on different server, i was thinking of looking at aspnet permissions, but any other suggestions too?

thanks

quote:
Originally posted by visakh16

is the package executed from the same machine?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs





then it may be that the account executing ssis package doesnt have access to those folders. is ssis executed from sql agent job or bat file?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

cipriani1984
Constraint Violating Yak Guru

United Kingdom
304 Posts

Posted - 01/14/2014 :  08:44:53  Show Profile  Click to see cipriani1984's MSN Messenger address  Reply with Quote
Im running this manually at the moment from BIDS.

How would I find out what service/account it is running under?

quote:
Originally posted by visakh16

quote:
Originally posted by cipriani1984

The folders are on different server, i was thinking of looking at aspnet permissions, but any other suggestions too?

thanks

quote:
Originally posted by visakh16

is the package executed from the same machine?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs





then it may be that the account executing ssis package doesnt have access to those folders. is ssis executed from sql agent job or bat file?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 01/15/2014 :  05:52:55  Show Profile  Reply with Quote
If you're running manually it uses your logged in credentials.
If that being case put a breakpoint and check if code is getting corect expected value for filepath.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000