locked
ajaxFileUpload - problem only on shared hosting - suspect Path.GetTempPath() RRS feed

  • Question

  • User-59642099 posted

    Hi all,

    I think this is a candidate for explaining without the code. I have a method written that saves the contents of an ajaxFileUpload control to an SQL DB using Entity Framework. It works great locally. However, the control throws a generic error on the server.

    I've read the documentation that explains how ajaxFileUpload writes the file temporarily to Path.GetTempPath(). I can watch and verify this happening locally. I suspect my issue is that on the server (which is shared hosting):

    Path.GetTempPath() = C:\Windows\Temp (so, I doubt I have permission...nor will anyone give it to me)

    I'm looking for a way to tell the ajaxFileUpload control to use the temporary directory I want it to use (or any other way you can think around this issue) rather than the default Path.GetTempPath(). Doesn't this seem like a logical property the control should have or is it just me?

    I'm sure most of you know this, but the .SaveAs() method is not the answer. This occurs AFTER the control has already upload the file to a temp directory (my point of failure).

    Thanks! 

    Wednesday, October 30, 2013 12:14 AM

Answers

  • User-59642099 posted

    Hi,

    Thanks for confirming the issue was as I expected. My question was how to change this property. I may be missing it (I hope), but I don't see a property I can modify to change this. I'm open to other ways to work around it was well.

    Thanks!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 30, 2013 6:15 AM

All replies

  • User-1315512054 posted

    Hello,

    You should use a folder to which have security write permissions. On your localhost you execute the script as Admin, but on shared hosting you execute it as the application pool user.

    Regards

    Wednesday, October 30, 2013 2:49 AM
  • User-59642099 posted

    Hi,

    Thanks for confirming the issue was as I expected. My question was how to change this property. I may be missing it (I hope), but I don't see a property I can modify to change this. I'm open to other ways to work around it was well.

    Thanks!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 30, 2013 6:15 AM
  • User-59642099 posted

    BUMP

    Does anyone know how to change the temp directory this control uses? Shared hosting will not allow me to access this directory.

    Thanks!

    Monday, November 4, 2013 1:04 PM
  • User-933407369 posted

    hi  mattdaddym2,

    I would suggest that you read this reference below:

    how do I access a folder on the shared hosting space

    http://stackoverflow.com/questions/8776806/how-do-i-access-a-folder-on-the-shared-hosting-space

    http://stackoverflow.com/questions/10749880/file-upload-permission-denied-godaddy-shared-hosting

    hope it helps you.

    Monday, November 4, 2013 9:59 PM
  • User-59642099 posted

    Hi,

    I must be missing something. To clarify, the hosting provider is NOT going to give me acceess to C:\Windows\Temp, and the upload control does not allow me to change the temp directory that I can tell (this is where I was hoping to get advice).

    I appreciate your reply, but I didn't see anything that would resolve this issue. I'm currently experimenting with other upload controls.

    Thanks.

    Monday, November 4, 2013 10:45 PM