« Previous Next »

Thread: Unable to save image

Last post 06-23-2009 1:42 AM by almighty_in. 8 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (9 items)

Sort Posts:

  • 06-17-2009, 2:58 AM

    Unable to save image

    Hi All,
    I am working on a web application in .net 2.0 . I have created a vbscript funtion on my aspx page to save an image on server. It is woring fine on windows XP using http:\\localhost\virtualdir\Images\imagename.gif, when I run the same code on windows Vista it is showing scripting error
    "Unable to save data". When I hard coded the folder path(drive path) e.g. C:\Image\Imagename.gif where the image is to save then it is working on server
    itself only, and showing same error when the application is run on some remote machin(b'cause it looks for C:\Image\Imafename.gif  on the client machin) .
    Even I have tried it out using machine IP instead of localhost and also with 127.0.0.1 which is default for windows vista, but agian
    showing the same error.i think due to some security or IIS permissions on vista is not allowing to save image using localhost or IP.

     Please also discuss how to set the Verbs (same in case of windows XP it is found when right click on the Project in IIS then configurations and then Verbs).

    Any help will be highly appriciated.
    Thanks!!

  • 06-17-2009, 3:14 AM In reply to

    • lextm
    • Top 10 Contributor
    • Joined on 10-22-2008, 12:18 AM
    • Shanghai, PRC
    • Posts 1,258

    Re: Unable to save image

    I guess it is a permission issue. Generally speaking, the change you noticed started much easier since the introduction of Windows Server 2003 and IIS 6. Now by default, IIS worker process runs under Network Service account which has a very limited set of permissions and rights.

    To verify if my guess is right, you can go to IIS Manager and find out which application pool hosts your web application. Then you can configure this application pool to run under Local System (via Advanced Settings button in the right panel) instead and test again.

    Besides, why you want to configure verb? It is a bad idea to enable PUT as it exposes too much to the outside world. ASP.NET provides you a lot of new ways to upload files. For example, the FileUpload control.

    http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/standard/fileupload.aspx

    Lex Li
    Support Engineer at Microsoft
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 06-17-2009, 7:26 AM In reply to

    Re: Unable to save image

    lextm

    Its again showing the same error message "Unable to save data" after changing application pool hosts to Local System.

    I am saving the imge using scripting, so can not use the FileUpload control.

  • 06-17-2009, 9:39 PM In reply to

    • lextm
    • Top 10 Contributor
    • Joined on 10-22-2008, 12:18 AM
    • Shanghai, PRC
    • Posts 1,258

    Re: Unable to save image

    Then it is more than a permission issue.

    Why kind of script did you use? Generally speaking, such script is not supported on this IIS forum. Can you post this question to forums at www.asp.net? There are more ASP.NET experts.

    Lex Li
    Support Engineer at Microsoft
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 06-18-2009, 12:27 AM In reply to

    Re: Unable to save image

    lextm Firstly I posted the same issue on ASP.NET forum, people asked for the scripting code and the error generated and after seeing that they asked me to post this issue to this forum as it is seemed some permission issue on IIS, look at it http://forums.asp.net/p/1433093/3238512.aspx#3238512
  • 06-18-2009, 12:51 AM In reply to

    • lextm
    • Top 10 Contributor
    • Joined on 10-22-2008, 12:18 AM
    • Shanghai, PRC
    • Posts 1,258

    Re: Unable to save image

    OK. I saw you provided more information on that thread.

    405 for PUT requests means HTTP PUT verb is not enabled so that you need to enable that verb. On IIS 7, this can be done via IIS Manager,

    1.  Find the web site in the left panel.

    2. Click Handler Mappings icon in the middle.

    3. Find the handler for the type of path for the PUT requests. Double click it.

    4. In the dialog click Request Restrictions button.

    5. Navigate to Verbs tab and switch to All verbs (or add PUT to the text box).

    Note that there may be other changes necessary (such as in Access tab you may need to use Write).

    As I mentioned before, PUT verb is too powerful to be enabled. It is highly recommended to use other approaches to save images to the server, such as FileUpload control.

    Lex Li
    Support Engineer at Microsoft
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 06-18-2009, 6:27 AM In reply to

    Re: Unable to save image

    lextm

    There is no handler for the type of path for the PUT requests, should I add new one to this list and then set verbs, or this is some other way I can do this.

  • 06-18-2009, 7:05 PM In reply to

    • lextm
    • Top 10 Contributor
    • Joined on 10-22-2008, 12:18 AM
    • Shanghai, PRC
    • Posts 1,258

    Re: Unable to save image

    Please note that there may be handlers registered for wildcards in the IIS Manager (for example, WebDAV and StaticFile).

    In my box, WebDAV handles PUT requests for me.

    Lex Li
    Support Engineer at Microsoft
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 06-23-2009, 1:42 AM In reply to

    Re: Unable to save image

    I found it in StaticFile, it already have all the verbs, I gave write access to it...

    but still its showing the same error. not worked :(

Page 1 of 1 (9 items)