Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19344 |

    I’m trying to unzip a zip file on my hosting using the Xceed ZIP component,
    but get the following error message :

    The physical file represented by the item could not be created. Type: Xceed.FileSystem.DiskFile FullName

    Is it a permission problem ?
    If so , is there a workaround ?

    Thanks
    Alon

    Imported from legacy forums. Posted by alonhr (had 3300 views)

    User (Old forums)
    Member
    Post count: 23064

    Hello Alon.

    You will have to provide us with your code, and the InnerException of this FileSystemException you’re getting. There are many possible reasons why a file could not be created.

    Imported from legacy forums. Posted by Martin (had 153 views)

    User (Old forums)
    Member
    Post count: 23064

    This is the ASP.NET Code

    Imports Xceed.Zip

    Imports Xceed.FileSystem

    Public Class WebForm1
    Inherits System.Web.UI.Page

    #Region ” Web Form Designer Generated Code “

    ‘This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    ‘CODEGEN: This method call is required by the Web Form Designer
    ‘Do not modify it using the code editor.
    InitializeComponent()
    End Sub

    #End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ‘Put user code to initialize the page here

    Try
    ‘ License the component. For more information jump to the licensing topic.
    Xceed.Zip.Licenser.LicenseKey = “SAMPLE-APPLICATION-KEY”
    Dim zip As New ZipArchive(New DiskFile(Server.MapPath(“.”) & “\linkexchange_sp.zip”))

    Dim folder As New DiskFolder(Server.MapPath(“.”))
    zip.CopyFilesTo(folder, True, True)
    Catch err As Exception
    Response.Write(err.Message)
    Finally
    End Try
    End Sub

    End Class

    and the error :

    The physical file represented by the item could not be created. Type: Xceed.FileSystem.DiskFile FullName: c:\inetpub\wwwroot\UnZip\linkexchange_sp.sql

    Imported from legacy forums. Posted by alonhr (had 277 views)

    User (Old forums)
    Member
    Post count: 23064

    Hello Alon.

    The ASPNET user probably doesn’t have write access to the root of this web app (“c:\inetpub\wwwroot\UnZip” in your case). I guess you are only testing stuff, but it’s generally not a good idea to grant that right anyway. You’ll probably want to unzip in a subfolder, granting write access to that special subfolder only.

    Also, remember that a web app may be accessed more than once at the same time. While two or more processes may read the zip file at the same time, they can’t write to the same file at the same time. You’ll probably want to unzip your files in a unique filename or unique subfolder within the first subfolder.

    Hope this helps.

    Imported from legacy forums. Posted by Martin (had 4242 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.