How to Move Folder in WebDav using Sardine? - webdav

I am using Sardine client to move folder in WebDav. It is not working. But if it is file type it is working fine.
sardine.move("http://ip/webdav/kamesh/CloudDrive/test123","http://ip/webdav/kamesh/CloudDrive/Media/kmmm");
Please help me, what I need to do move folder?

Related

WP File Manager - Cannot view PDF

I am working for a client and cannot seem to find the solution to this issue. When changing the file path for the root directory of the WP File Manager we can "lockdown" and specify that we want the /home/site_name/files folder for the users to see when logged in. The default file path is /home/site_name/ and I can view the PDF's in the files folder by navigating and opening them up.
But once I specify that I want only the contents in the /home/site_name/file to be viewed I can no longer open the PDF's, it will give me a 404 this page cannot be found. If I take this URL and add in the /files/file_name then it loads... there is some disconnect between the link and the file path and I cannot figure it out.
Let me know if anyone has seen this before while using Wordpress File Manager!
Thanks!!
Update: After contacting the developers of the plugin there was a known issue with it, now with the new version the bug is fixed

ASP.Net Accessing Server Filesystem

I am having trouble accessing information on the server my website it on. As the website was originally programmed with VB.Net, I cannot change the language without having to completely reboot the website. The way the website and server are configured, I can only use ASP.Net and VB.Net.
I am needing to add a section where they can create folders, edit folder names, and upload pictures and text documents on the server through the public website. I tried using parts of the FileIO, Server, and Http that should have worked, but none of them did. Most of my research is about local files and text documents.
I have not been able to find any information that works. Can someone help me? Thank you.
Firstly, creating a virtual directory in ISS mapped to somewhere on your disk would be a good start. This way you have a separate folder for user data in a folder with write access (make sure IIS has write access to the folder!), and the folder is not affected by website deployments.
Secondly, you might need to resolve absolute path for most of the System.IO.File calls. See How to convert a relative path to an absolute path in a Windows application?, just you will need to convert this code to VB.

How to handle path on azure for XmlDocumentationProvider

I am using azure for deployment of my new Web API's, I am new with deployment on IIS and azure.
I have added my Web API's on azure as web application, and it's working fine, till I added documentation for each API's functions. After adding description I uncomment line below from HelpPageConfig.cs.
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
It's working finr locally, and I am able to see all descriptions, but when I published it on azure, I am getting error saying,
Could not find a part of the path 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
site url : http://mejodo.azurewebsites.net/
Do I need to change path ?
File is already created in my system on D:\home\site\wwwroot\App_Data directory.
What changes I need to do to make it work ?
I had the same issue. For me the file was generated. Please follow the below steps.
Click on show all files in solution explorer.
Check whether you have a file in App_Data folder
If you have the file, right click and include the same in your project.
Now build and publish to Azure.
I hope this will work. Thanks
In my case XmlDocument.xml had to be added in Visual Studio to the App_Data folder within the solution using 'add existing item'.
Just add to your project new folder "App_Data" with XmlDocument.xml and publish
When you say that you have Web API's on azure as web application, do you mean that they are applications under the site ? If yes, then I think you are missing the application name in the path to the XML file.
Try going to mejodo.scm.azurewebsites.net > debug console > powershell to see the exact folder structure....
You must verify that the line in the HelpPageConfig.cs file in the Area>HelpPage>App_Start folder.
that is in the register method, this line is
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
this uncommented
then you must verify that in the project configuration, in the build XML documentation file, this is the same path as the above mentioned line.
When you publish the xml file goes in the bin folder, so change 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
to
'D:\home\site\wwwroot\bin\XmlDocument.xml'.
and it should work.

ImageUrl trying to display an image outside of project root

I am working with two different web sites in asp.net. In the first project i upload some images to a specific folder under the project root and save just the filename in the database, now i am trying to display this images at some page of the second project I know the filename from the database and the image folder as absolute pat but I have not been able to display the image, even thought when looking in firebug the image src is correct src="D:/MyFolder/image.jpg" the image does not display, probably because it is not pointing in the right directory.
I have also tried using Server.MapPath and then my D location but still no success.
I am sure someone has faced the same situation before and was really hoping to get some hint to manage this.
Thank you in advance
I found my solution, strange but i didn't catch it before. Uploaded pictures under a project can always be accessed using the url of the project http://www.yourwebsite.com/images/photo.png now in the second project you can use reference the images using this url and concatenating the file name which i store on database. I think this is the best solution and without changing the code access security which i think can bring other problems with it. Anyway thank you guys.
If you want to display the image that is not in your project (I mean it is present in some other project or some other drive) just create the virtual directory in IIS
Go to "Run", type inetmgr
Right click on your project and add virtual directory
Give alias name and path so that it acts like folder in your project
I don't think you can serve files outside of your application path by default. It's called Code Access Security. You can read up on it here:
http://msdn.microsoft.com/en-us/library/930b76w0.aspx
You can fix this by changing your trust level to High in your web.config:
http://msdn.microsoft.com/en-us/library/tkscy493.aspx
I wouldn't recommend doing this for any site that is externally accessible. In fact, depending on how/where you're hosting your application, this option may be restricted.
You can only "link" to files that exist relative to the same project or are hosted on another site via an absolute URL.
If you want to service files outside the application/website (on disk or in a database) you will need to build a mechanism that gets the file and binary writes it to the browser, setting the MIME type etc. This is best done using an HttpHandler.

Website missing after copying to wwwroot folder

I am trying to deploy a website; i have copy pasted the code into the webapps\wwwroot folder by creating a folder
Then when taking inetmgr ;
i am cannot see any of the folder in the folder structure to right click and create a applciation
Please help me
I know this may sound simple and I don't mean to be belittling when I ask this; but have you refreshed your IIS manager? Are you sure you have looked in the right area in IIS or have put the folder where you thought you did?

Resources