First of all, thank you all for taking time to read the question.
I am embedding Microsoft WebBrowser ActiveX control into my application. Normally such a WebBrowser instance saves cookies and caches to the system default location C:\Users\${foo}\AppData\Roaming\Microsoft\Windows\Cookies.
I want to store cookies in another directory. SFAIK that WebBrowser control uses WinINet to access caches and cookies. I think I should call InternetSetOption with a proper option flag. Can anybody shed some light on it?
WinInet does not give you the option of programmably changing the paths of its storage folders. The location of the Cookies and Cache folders are part of the calling user's profile instead.
Specifically, they are determined by the CSIDL_COOKIES and CSIDL_INTERNET_CACHE shell folders (FOLDERID_Cookies and FOLDERID_InternetCache on Vista+), which are configured in the following Registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
Related
I have an app that reads a jpg file and displays the embedded GPS location on a google map using a TChromiumWindow.CreateBrowser component. (Delphi Berlin and CEF4Delphi latest version). Every time I run it I have to accept or deny cookies.
How do I make it remember my cookie choice ?
I have tried setting up a ICefCookieManager cookie manager but there is no option to set a cookie store and the cache folder remains empty. Also looked at a number of GlobalCefApp ideas I found on the internet without success.
The cookies are saved with the cache files.
Set the cache directory in GlobalCEFApp.Cache before the GlobalCEFApp.StartMainProcess call in the DPR file like this :
GlobalCEFApp.Cache := 'c:\my_custom_cache_directory';
Make sure that the windows user executing your application has write privileges in the cache directory.
With this setting you will only have to deal with the "accept or deny cookies" dialog the first time you visit a web page or when the cookies expire.
Whenever I navigate to maps.google.com via my dcef3 instance (TChromium), the "welcome" bit always appears over the top. Can I turn this off somehow with some setting? If I go to maps.google.com in Chrome or Firefox, it doesn't appear.
I thought it may have been something to do with cookies maybe, so tried setting CefPersistSessionCookies to true but no luck. Maybe I need to set an Option property with TChromium or handle some other event? I have made no other changes to the default values for TChromium.
It seems I needed to have a cache_path set (CefCache). According to doco:
cache_path The location where cache data will be stored on disk. If
empty an in-memory cache will be used for some features and a
temporary disk cache will be used for others. HTML5 databases such as
localStorage will only persist across sessions if a cache path is
specified.
So it seems (almost obviously to me now) that cache is needed.
I´m making a web application in MVC, I have a view where I select a file from my pc directory (like opendialog form in windows applications), bootstrap´s fileupload gets the file name but I want to know his physical path to. Because I want to save it in my data base (where file come from).
Anybody can help me??
Thank you in advance!
You can't, this information is never sent to the server for obvious security reasons. Only the filename is sent to the server. So you cannot store the physical path where the file originated from the client machine on your server.
When you upload a file via a web browser, the actual file path is not supplied. This is seen as being a security feature.
There is no way to circumvent this using pure HTML. Some people get around it by using a plugin such as Flash or Silverlight to upload the file, but I recommend living with this feature if you can.
Am using JSF and primefaces to develop web application.I want to open existing files on client machines using dialog box which prompts the user to select a path and the corresponding file. Please suggest a component which can be used.
While I doubt the feasibility of your intentions; accessing content directly on a client's machine (some security implications there), a combination of <p:media/> and <p:lightBox/> will work for you. There are file type restrictions imposed by primefaces though (multimedia files and pdf only) The <p:media/> can be embedded in the <p:lightBox/> like so :
<p:lightBox>
<p:media value="{yourBean.filePath}" width="100%" height="300px">
</p:lightBox>
Like I said, I doubt the feasibility of directly streaming content from a client's local filesystem. How do you intend to use the path c:\Users\john doe\my documents\my books\book.pdf on a user's local system within your own web application, without first uploading the file to your own webserver? With image files, you might have some success loading the file into memory and streaming the file directly from RAM using <p:dynaImage/>...consider the scalability of this option too for a high traffic application
Where exactly is the IsolatedStorage on the android devices. I would have expected it to be in the /mnt/sdcard/Android/data/[packagename]/ location, but it is not. I used the File Explorer (from eclipse) to try and find it, but I can't.
If I can somehow load a html page into the WebView or play a video from IsolatedStorage, then I won't need this actual path. But, I don't want to copy the movie to a temporary location in order to play it, I might as well just store it on the SD Card.
The reason I am using IsolatedStorage is to minimize the custom code across the platforms, I am developing for the Windows Phone, which only allows for IsolatedStorage.
To determine the directory in which your "isolated storage" aka internal storage is kept, use the GetFilesDir() method. This method is part of the Activity base class. It is to be used for files you do not want other applications to have access to.
Other useful methods
GetFilesDir():
Gets the absolute path to the filesystem directory where your internal files are saved.
GetDir():
Creates (or opens an existing) directory within your internal storage space.
DeleteFile():
Deletes a file saved on the internal storage.
FileList():
Returns an array of files currently saved by your application.
See the android developers documentation for more details
I found that IsolatedStorageFile points towards internal memory only.
I used the Context.GetFilesDir() and the Context.GetExternalFilesDir() depending on the user's selection.