locked
need folder structure information ........ RRS feed

  • Question

  • guys

    i have this piece of code..which is taking pdf files and storing them in seperate folder......suppose i dont know the project folder structure of my project..

    what would be folder structure and where files will be stored through this code

    here is code

    Public Sub GetFile(ByVal fileBytes As Byte(), ByVal fileName As String, ByVal USER_ID As Integer, ByVal USER_NAME As String)
            Dim dinfo As New System.IO.DirectoryInfo(Server.MapPath(String.Format("~/{0}/{1}/", USER_ID, USER_NAME)))
            If Not dinfo.Exists Then
                dinfo.Create()
            End If
            System.IO.File.WriteAllBytes(System.IO.Path.Combine(dinfo.FullName, fileName), fileBytes)
        End Sub


    thanks and regard love4csharp

    • Moved by Eason_H Thursday, December 5, 2013 6:00 AM
    • Moved by Carl Cai Friday, December 13, 2013 3:28 AM (from vb) asp.net forum is more dedicated for web issue
    Wednesday, December 4, 2013 6:28 AM

Answers

  • Hi,

    I am afraid that this is not the proper forum for this issue, since "Server.MapPath" is a method about web development, and there is a dedicated forum for web development issues:

    http://forums.asp.net

    You could post this issue in that forum for dedicated support.

    In addition, you could refer to http://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx for more information about this method.

    Thanks for your understanding.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by love4csharp Monday, December 30, 2013 6:53 AM
    Friday, December 13, 2013 3:27 AM

All replies

  • Hi,

    the folder structure would be "~/value of USER_ID/value of USER_NAME" or didn`t i understand your question ?

    Btw: you are posting VB code to the C# forum. Did you do this, because you don`t understand VB or did you just post to the wrong forum ?


    Hannes

    If you have got questions about this, just ask.

    In a perfect world,
    users would never enter data in the wrong form,
    files they choose to open would always exist
    and code would never have bugs.

    My Forum Threads


    • Edited by Heslacher Wednesday, December 4, 2013 6:35 AM
    Wednesday, December 4, 2013 6:34 AM
  • Hi,

    I am afraid that this is not the proper forum for this issue, since "Server.MapPath" is a method about web development, and there is a dedicated forum for web development issues:

    http://forums.asp.net

    You could post this issue in that forum for dedicated support.

    In addition, you could refer to http://msdn.microsoft.com/en-us/library/ms524632(v=vs.90).aspx for more information about this method.

    Thanks for your understanding.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by love4csharp Monday, December 30, 2013 6:53 AM
    Friday, December 13, 2013 3:27 AM