Different name for GroupDocs temp folder

Hi,


Is it possible to have a different folder name for default ‘Temp’ folder created by GroupDocs in the Documents location?

Thanks,
Dhivya

Hello Dhivya,


Thank you for your question. Yes, you can try to use the second parameter of the .rootStoragePath method. The second parameter is workingDirectoryPath .

Best regards.

Hi,


That seems to work thanks.

But if I want in the root of my website and i try to use “~\folder” then it is not working. I don’t want to use the exact location. How do I give the path in that case?

Thanks,
Dhivya

Hello Dhivya,


Thank you for the question. In that case you should do next:

1. Move GroupDocs.Viewer initialization in to the web page code behind. For example if you use Viewer on the default web page it will be Default.aspx.cs Page_load action.
2. Before use
Viewer.SetRootStoragePath(Server.MapPath("~/testfiles"));

Viewer.EnableFileListRequestHandling(true);
you should get file path of the document which you will view. For how to check this documentation
3. Then use this path in the Viewer.SetRootStoragePath
For example your file stored in the folder with name “test” and full path will be d:\MyCoolProject\test\documentForView.pdf In such case you will use “d:\MyCoolProject\test” as a root storage.

Best regards.

Thanks a lot. Everything is working fine now.


Thanks,
Dhivya

Hello Dhivya,


Glad to hear that.

Best regards.

Hi,


I have noticed that now I am getting 2 folders one is temp which is in my root folder and another is the foldername which i have given in workingdirectory parameter created in workingdirectory itself.

Temp is having Processing Folder in it whereas the working directory has cache folder in that.
Can I not have Temp folder at all? The documents are in DFS and we cannot have that folder in that location.

Please help.

Thanks,
Dhivya

Hello Dhivya,


Thank you for the request. Unfortunately no, you can’t disable cache functional from the Viewer.
For more information about the cache in the Viewer please check this documentation .

Best regards.

Hi,


Thanks. I don’t want to disable the cache function but I don’t want the temp folder in the rootfolder location. Can’t i have both processing and cache folder inside my workingDirectoryPath instead rootStoragePath?

Thanks,
Dhivya

Hello Dhivya,


The Temp folder and all it content will be created automatically in the folder which you set as a root storage (n the SetRootStoragePath() method). Since that you can’t change it location with out changin root storage. But as a workaround you can create your own storage provider and then use it in the SetStorageProvider() method. For info about it and example code please check “ViewingViaProvider” example project.

Thank you.

Thanks.


Where can I find that project? Can you let me give me the link or something to find it?

Thanks,
Dhivya

Hi Dhivya,


Please download examples package here .

Thank you.

Hi,


I cannot have any storage provider as the location of the files is in shared location and is in DFS for replication.

Is there anyway I cannot have Temp folder in that location as the application cannot have access to that location and if thats the only way to do it then Doc Viewer cannot be used. We have already bought the license and this issue can make us not to use Doc viewer resulting in loss.

Please help.

Thanks,
Dhivya

Hi,


Could you please try such approach:
protected void Page_Load(object sender, EventArgs e)
{
string files_folder = server.mappath(“files”);
Viewer.SetRootStoragePath(files_folder, files_folder);
Viewer.EnableFileListRequestHandling(true);
}

Best regards.

I cannot have same root and working folder path. Thats my main concern. The rootStoragePath is in replication and any folder added to that will need lot of configuration in DFS and still may not work due to replication.


To avoid this replication we want to have this Temp folder not in Root folder but in our website location. Please help as otherwise the viewer become unusable for us. We have already bought the license considering the 12 month support and excellent features of viewer. This hurdle can result in loss for us.

Thanks,
Dhivya

Hi,


Could you please share with us full structure of your project and web site with description where and what you have and where will be stored documents for view and in which exactly folder should be temp folder.

If you add screenshots of it will be useful.

Thank you.
We have a mvc web application and a desktop application. Web application is in london just for viewing documents whereas desktop application is in london and singapore in the users machine and users use it to upload documents which then replicates using DFS.

The documents are sitting in 2 different shared location in 2 places globally london and singapore. These documents get replicated between the 2 locations. The web application and documents sit in london but in different servers.

Now, I cannot have the temp folder in the shared locations. I need the temp folder to sit inside my website location which is london.

Thanks,
Dhivya

Hello,


Thank you for the description of the logic. Sorry but you missed to describe the folder structure that I have requested. Please share with us such structure (screanshot also will be useful) for both Apps:

Root of the App -
- Folder1
- some file
- one more file
- Folder2
etc.

And same for the second App.

Then set in which folders you have documents for view and in which should be stored the Temp folder.

Thank you.


Its a normal MVC application and the structure is same as any other mvc appication. Attached is the screenshot.


Second desktop app structure is not needed as we dont want to view documents in that. That app is not using doc viewer.

Documents for view are sitting in 3 shared locations across global in DFS and are accessed like \servername\foldername\subfoldername1…\filename.

Now, though i want to access the shared location documents I want the temp (preferably changeable name) folder to sit inside my MVC Application root folder.

Thanks,
Dhivya

Hi,


I have not heard anything from you yet. Is any any updates for this?
How do I fix this issue?

Thanks,
Dhivya