w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Ext JS : iframe load event for downloaded file from Chrome
It's a Google Chrome bug. I've solved it by using this plugin http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/ and a cookie.

Categories : Javascript

How to I get the cached Bitmap I downloaded using Volley ImageLoader?
Volley depends on your implementation of a cache for successful efficient caching. The constructor for the ImageLoader takes in an ImageCache which is a simple interface in Volley to save and load bitmaps. public ImageLoader(RequestQueue queue, ImageCache imageCache) A quote from the Javadoc of ImageCache interface: Simple cache adapter interface. If provided to the ImageLoader, it will be used as an L1 cache before dispatch to Volley. Implementations must not block. Implementation with an LruCache is recommended. Darwind is right. If you request an image and it is present in the cache it will be loaded from the cache and not from the web. This should be the case for you since you're loading and presenting an image, which if clicked should be displayed from the cache in your new

Categories : Android

Downloaded docx files corrupt in Chrome and IE (Railo/Coldfusion)
A work-around for this problem that i just implemented and which works: make a (temp-)copy of the file in a web-accessible directory cflocation to that file Ofcourse far from ideal - but it will do as short-term solution

Categories : Internet Explorer

Android Chrome browser unnecessarily renames names & types of downloaded files
Content-Disposition has a history of being a problem on Android. You are certainly welcome to try removing the UTF-8 part and see if that helps Chrome. But definitely test the original Android Browser app as well, as numerically that's the most popular browser for Android. See also: http://code.google.com/p/android/issues/detail?id=11422 Android browser/webview bug? Content-Disposition: attachment; filename="xyz.txt" http://code.google.com/p/android/issues/detail?id=9991 http://thedigiblog.wordpress.com/2011/04/19/android-and-the-download-file-headers/

Categories : Android

Export to Excel button from web page gives an error after the file is downloaded to the users machine: "File format or file extension is not valid"
The method I've used in the past utilizes the EPPlus library: http://epplus.codeplex.com/ So include that in your project, then you can call this method, just pass in your DataTable: public static void DumpExcel(DataTable dataTable) { using (ExcelPackage package = new ExcelPackage()) { ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("DataTable"); worksheet.Cells["A1"].LoadFromDataTable(dataTable, true); for (int i = 1; i <= dataTable.Columns.Count; i++) { worksheet.Column(i).AutoFit(); if (dataTable.Columns[i - 1].DataType == System.Type.GetType("System.DateTime")) { worksheet.Column(i).Style.Numberformat.Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;

Categories : C#

Parsing Local XML File Works, Downloaded XML File Doesn't
A couple of observations: The key issue would appear to be that you retrieved the data in rspData, but when you write it to your temporary file, you're writing data, not rspData. So change the line that says: [data writeToFile:path atomically:YES]; to [rspData writeToFile:path atomically:YES]; Frankly, I don't even see the data variable defined at that point (do you have some ivar lingering about?). I'd be ruthless about getting rid of any ivars or other variables that you don't need, so that you don't accidentally refer to some unused variable. Anyway, just use the rspData that you retrieved rather than some other variable. Why are you even writing that to a file, only to then read the file into another NSData that you pass to your XML parser? That seems entirely unnecessary. Just

Categories : Iphone

Corona SDK: Get file size of JSON file to be downloaded
Turns out, it is usually not possible when dealing with json (and other non-binary files) http://docs.coronalabs.com/api/library/network/request.html#download-file-with-progress-updates

Categories : Lua

Test for file on sd card - cached?
If you remove a device without unmounting it properly, you will observe this behavior. There's really nothing you can do about it. At least nothing simple. You could try to detect if the block device is present by writing something to it (perhaps creating a new file) then calling fsync. If the block device is no longer there, the fsync will fail. I'm not sure how to do that in a bash script, though. You should just make sure you don't eject your SD cards without unmounting them first.

Categories : Bash

How to link .cpp file to .h file for a downloaded library
That linker error normally means that the header file is being included just fine, but the library however, isn't included. I don't know Clang, so can't give a full answer for you, but for g++, you'd need to find the library file and make sure its directory is in your LD_LIBRARY_PATH, then take its name; it will be something like "libStanfordCPP.so". You then need add a flag to the linker on the command line that contains the bolded part of the name (between lib and file extension) after -l (hyphen-L), so here that would be -lStanfordCPP. Your command line then looks something like: g++ -o bin/random random.cpp -lStanfordCPP Unfortunately this isn't Clang, but it ought to work about the same. If someone else would like to provide the Clang way (or verify you can do this with Clang)

Categories : C++

File name changes after opening downloaded excel file in .Net C# MVC
This is called Extension Hardening. Execute steps to avoid this error. Open your Registry (Start -> Run -> regedit.exe) Navigate to HKEY_CURRENT_USERSOFTWAREMICROSOFTOFFICE12.0EXCELSECURITY Right click in the right window and choose New -> DWORD Type “ExtensionHardening” as the name (without the quotes) Verify that the data has the value “0″ NOTE There is one thing that has to be borne in mind when serializing in XML. XML is not Excel’s standard format and it has to open the file as XML data. This means that when opening the file it will issue a couple of warnings which are more of a nuisance than anything else. Back to your original Query : Replicated your issue and below is the fix Sample Class public class StudentModel { public string Na

Categories : Asp Net Mvc

How to include a rendered php file that has been cached to HTML
You can still call a php code and variables even in cached files. There is a way how to "bypass" this. I don't know how exactly you cache, but using PHP it's something like this: <?php /*start caching*/ ob_start(); SOME PHP OR HTML CODE HERE /*this will store "already executed code" in cache and clears the buffer*/ $storecodeincache .= ob_get_contents(); ob_end_clean(); /*now at this point there is a piece of code we want to execute later, so we use the same variable, but we store store PHP code we want execute later like this:*/ $storecodeincache .= 'SOMEPHPCODE'; /*we start regular caching again*/ ob_start(); SOME PHP OR HTML CODE HERE /*we are finished, we want to store the rest*/ $storecodeincache .= ob_get_conte

Categories : PHP

How to Get the images from cached image file into drawable
Use serious libraries instead of your custom implementations. The great library for downloading and caching images is Universal Image Loader

Categories : Android

Expansion file downloaded but not there
It's probably because the file was found to be "incomplete" when doing checks after completion, and was then deleted. One possibility is the downloaded file's length is different than the one you provided to android.vending/expansion/downloader.Helpers.deosFileExist(Context, String, long, boolean), so first check to see the provided value matches the actual value. If this doesn't resolve the issue, then consider adding breakpoint to all File delete calls and see if any of them are triggered.

Categories : Android

UTF-8 Encoding name in downloaded file
Use method setCharacterEncoding: Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. If the character encoding has already been set by setContentType(java.lang.String) or setLocale(java.util.Locale), this method overrides it. Calling setContentType(java.lang.String) with the String of text/html and calling this method with the String of UTF-8 is equivalent with calling setContentType with the String of text/html; charset=UTF-8. This method can be called repeatedly to change the character encoding. This method has no effect if it is called after getWriter has been called or after the response has been committed. Modify your code with following: response.setContentType("application/ms-excel; charset=UTF-8");

Categories : Java

downloaded exe file is corrupted
A .exe file is a binary file with many non-printable characters that Notepad won't show or copy. Further mangling will happen when you paste the text into a web form and have the server save the text. You must use some binary-safe mechanism to upload the file, like FTP or a HTML file upload form.

Categories : Java

Excel downloaded as zip file in IE
This isn't a Dojo problem. Instead, the server is probably sending the wrong mime-type in the headers when the browser accesses the URL. You might be able to work around it with an .htaccess file. It works in IE only because Microsoft gave it special-case behavior to handle their own Office file formats.

Categories : Javascript

Visual Studio could not load file or assembly; maybe cached?
even though i don't need that dll Visual Studio will usually remove unneeded DLLs. Typically this is caused by dependencies (which are harder to keep track of). I want to remove it. Check in the References of the project in the Solution Explorer. If any of them have a yellow triangle that means they can't be found (the project may still compile and run if you aren't actually using that reference). is it possibly in a cache? As Daniel Kelley mentioned C:Windowsassembly and C:WindowsMicrosoft.NETassembly are where the global assembly cache is located. If it isn't there check the Hint Path of the reference (it will show up in Properties). Good luck finding your reference, keep in mind that you need not only the actual DLL but all of its used references in most cases. Also a

Categories : C#

MD5 of file downloaded from database, from a JSONObject
OK, in SQL there's a build-in function that looks like this: select *, convert(varchar(50),master.sys.fn_repl_hash_binary(a.BinaryField),2) as 'MD5Hash' from SomeTable a You give the fn_repl_hash_binary the name of the binary field you're reading, plus "2" as an argument which tells SQL to calc the value as an MD5; I think "1" is SHA. And in Java, you can use something like this: private String getMD5Hash(byte[] bytes) throws java.lang.Exception{ String s="This is a test"; MessageDigest m=MessageDigest.getInstance("MD5"); m.update(bytes,0,bytes.length); return new BigInteger(1,m.digest()).toString(16); } This should do the trick. Best of luck, CodeWarrior.

Categories : Sql Server

How do I append to a file downloaded from libcurl?
This is not a real answer, but it's too long to fit in a comment as such. I just wrote this little program to test the principle: #include <stdio.h> void append_string_to_file(const char *filename, const char *string) { FILE *f = fopen(filename, "a+"); if (f) { printf("Appending string to file %s ", filename); fputs(string, f); fclose(f); } } int main(int argc, char **argv) { int i; for(i = 1; i < argc; i++) { append_string_to_file(argv[i], "This string is added to end of file... "); } return 0; } And in my testing, it performs exactly as expected. Since using CURL is unlikely to affect the ability of "stdio.h" functions to operate correctly, I think you need to take your code apart and see which part doe

Categories : C

Can't find downloaded file on device
Few things: Environment.getExternalStorageDirectory(); is not the right place to save a file, you need to give it a filename. Environment.getExternalStorageDirectory() + "/myfile.pdf"; Also make sure you have the following permission in your manifest.xml: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> Also, onDestroy() is not guaranteed to get called so this is not a good place to check. Finally, to see the file when you connect your device to your pc you might need to let MediaScanner know that there's a new file to index. Send a broadcast once the file has been saved to ensure it gets picked up in the MediaStore Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); intent.setData(Uri.fromFile(file)); sendBroadcast(intent);

Categories : Android

Windows: How to lock an FTP downloaded file
No, there is no standard locking mechanism, it's all between up to you and the other party. Here are some ways to do it in addition to creating a .complete file; The uploader uploads the file as file.xls.tmp, and when it's complete, rename to file.xls. The uploader uploads to a tmp directory, and when it's complete, moves it to the scanned dir. The uploader uploads the file, and the downloader scans file dates to find files written before a certain time. This is not as reliable, since a file from a crashed uploader may be scanned. There are probably more versions, particularly with a custom ftp server, but using the plain standard doesn't allow for much "fancy stuff".

Categories : Windows

Getting the browser to use a specific name for file being downloaded
The code you have shown will produce a file with a name of '/var/www/client/image.jpg' which is obviously not a valid file name, which is why your file gets named after the script. $fileName is the desired name of the output file, $fullpath should be the absolute path to the desired file, php's relative paths do not work like HTML's paths do. '/' will not point you to the document root folder.

Categories : PHP

How to keep downloaded file in memory through ajax
Step 1. Safari should support HTTP compression. Your best best is to leverage this, as opposed to figuring out a way to unzip a file using JavaScript. It looks like there are a few options with PHP: http://php.net/manual/en/zlib.configuration.php http://php.net/manual/en/function.ob-gzhandler.php Or even at the server level: http://httpd.apache.org/docs/2.2/mod/mod_deflate.html Step 2. Use sessionStorage to cache the configuration settings. The data will be cleared out each time a user closes their browser. Step 3. The PHP handler that is called by the AJAX request should take care of parsing the config files and send JavaScript-friendly JSON to the browser. Use JSON.parse() and JSON.stringify() to serialize/de-serialize data as you read/save to sessionStorage.

Categories : Javascript

How to open latest downloaded file
If you know what the base file name would be (in your case F90CR0010-HBR-C-4.pdf ) then you can use a simple regex to check for strings of the form F90CR0010-HBR-C-4(d+).pdf . If you find one then just figure out which one has the biggest number and open that one. Its not really pretty, but it works. Also, technically this can be "hacked" by making your own file called F90CR0010-HBR-C-4(999999).pdf, but I would guess you dont really care.

Categories : Java

CakePHP performance issues - cached view file size
I was able to vastly reduce the size of cached view files in the end by making these two changes. Hopefully it is useful to anyone who runs into a similar issue. 1 - Model There was a number of relationships between models, however I was only actually making using of the data on one side of the relation. For example, an article had images, but I also had a relation to get the article belonging to an image, which I never did. Making the relations 'one way' i.e. as required cut down on heavy queries. 2 - Controller In my paginate array I had 'recursive'=>2, which was causing hundreds of extra queries per page. I was able to cut the queries on a heavy page down from 900 to 20 by changing this option to 'recursive'=>1. There was about 6 many to many relations on the model in question

Categories : Cakephp

Listening for downloads from browser/getting name of downloaded file
You have to use a BroadcastReceiver (After api 9). Like this: BroadcastReceiver receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) { long downloadId = intent.getLongExtra( DownloadManager.EXTRA_DOWNLOAD_ID, 0); Query query = new Query(); query.setFilterById(enqueue); Cursor c = dm.query(query); if (c.moveToFirst()) { int columnIndex = c .getColumnIndex(DownloadManager.COLUMN_STATUS); if (DownloadManager.STATUS_SUCCESSFUL == c

Categories : Java

Open a downloaded html file with WebView
you can use loadData instead, but you need to read the file first: data = readFile(Environment.getExternalStorageDirectory().toString() + "/Android/data/com.whizzapps.stpsurniki/" + razred + ".html"); webView.loadData(data, "text/html; charset=UTF-8", null); //or //webView.loadDataWithBaseURL(null, result, "text/html; charset=UTF-8", null, null); here is a function to read the file private String readFile(String path) throws IOException { StringBuilder sb = new StringBuilder(); BufferedReader br = new BufferedReader(new FileReader(path)); try { String line = null; while ((line = br.readLine())!=null) { sb.append(line); } } finally { br.close(); } return sb.toString(); }

Categories : Java

Removing spaces in a downloaded Text File in VB
You could try removing all characters from each string that don't fall within range of ascii characters (hex 0x20-0x7E) using a regular expression: Dim PatchList = wc.DownloadString("http://127.0.0.1:8080/patch/PatchList.txt").Trim Dim tLines As String() = PatchList.Split(Environment.NewLine) For i As Integer = 0 To tLines.Length - 1 tLines(i) = Regex.Replace(tLines(i), "[^u0020-u007E]", String.Empty) Next ASCII table: http://www.asciitable.com/

Categories : Vb.Net

Loading .js file in UIWebview from bundle downloaded as a zip
// Try this NSString *test = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"/contentNewVersion.bundle/index.html"]; NSLog(@"%@",test); [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:test]]];

Categories : Javascript

Changes being made to a file downloaded with libcurl don't take effect
you are not using "short_database" nor "file_to_write" in your download()-function. So you download /tmp/musiclist.txt from the ftp-server instead of musiclist.txt. you should check your defines, and when you use a define and when you use a stringvariable and when you use parameters #define DATABASE_FILE "/tmp/musiclist.txt" #define REMOTE_DATABASE_FILE "musiclist.txt" int main() { remove(DATABASE_FILE); download(DATABASE_FILE, "musiclist.txt", REMOTE_URL, "Testing 123"); // ^^^ should't this be REMOTE_DATABASE_FILE? ... } void download(const char* file_to_write, const char* short_database, const char* addr, const char* msg) { remove(DATABASE_FILE); // again?!? struct FtpFile ftpfile={ DATABASE_FILE, /* name to store the file as if succesfu

Categories : C

How to save file downloaded by lftpget to the specified path?
The JSP is being executed on the server. There's no way to make the PDF appear at the client without transmitting it from the server, after the server downloads it, or doing a redirect to the ftp://... URL. This would involve restructuring your code and web interaction, as you're already in the middle of sending an HTML document and can't just switch mid-stream to sending a PDF. How to do this is probably beyond the scope of what can be taught here.

Categories : Java

How to identify if uploaded excel file is same as that is downloaded?
An idea would be to add an unique ID somewhere inside the file and lock those cells from editing. You could check this tutorial on how to Lock or unlock specific areas of a protected worksheet Also, you can compare the files' creation date timestamps and check if they're the same.

Categories : Java

Open downloaded file in browser pdf format
Try pdf.js. Firefox recently started using it as viewer for PDF files, but you can integrate it in your app. But you still need to 'download' it, that is, load into the browser.

Categories : Ruby

Downloaded project .xib file cannot open in XCode 4.6.3
According to the error, the project was probably made in a newer version of Xcode than the one currently on your machine. Update your software and if it still doesn't work, I'd assume it was made with the newest developer only version, Xcode 5. If this is the case you must purchase a developer account at the: iPhone Developer Center and download Xcode 5. If you do not want to do that, you cannot use the project.

Categories : Objective C

Avoid corrupted zip file downloaded - Android
I don't think that there is a way to restore the corrupted data, but if the ZIP-file isn't very large, you could check the MD5-checksum of the original file, and the (potentially) corrupted ZIP you've downloaded. If the checksums match, everything is okay, if not, download it again.

Categories : Android

can't immediately read downloaded text file
You should read the Data in onPostExecute(...) Method of your Async Class. Because onPostExecute(...) method will be executed after the doInBackground(...) method finish it's processing, Where as onPreExecution(...) method is called before the doInbackground(...) method is called. So currently you are trying to open the file, that is yet to be downloaded in your doInBackground(...) method Your code should be like this: private class DownloadTextFile extends AsyncTask<String, Integer, String> { @Override protected String doInBackground(String... sUrl) { // download text file } @Override protected void onPostExecute(.....) { super.onPostExecute(); // read text file }

Categories : Android

ftpclient downloaded file corrupted in android
You're not using the write method. setFileTransferMode is for transfer modes. setFileType is for setting file types. .setFileType(FTP.BINARY_FILE_TYPE); See the docs for setFileType and setFileTransferMode.

Categories : Android

Stop css file from being downloaded when on a mobile view
you can use @media only screen and (min-device-width : 320px) and (max-device-width : 480px) http://css-tricks.com/snippets/css/media-queries-for-standard-devices/

Categories : Javascript

Why when launching Chrome and loading html file to chrome it's taking so much time to load it?
I think that is because the page you are trying to load has its html part in other file and other elements belonging to same page are in a folder,not to mention designer webpages and sites have hundreds and thousands of elements in them.From elements i mean separate stylesheets,separate script files,graphics such as images including site banner and others etc.Assigning hundreds of elements to correct places obviously takes some time. My opinion would be to first change the following setting in Chrome(To change them type 'chrome://flags' (without quotes) and press Enter button this will bring you to internal settings page of Chrome).Once you have settings page opened locate following setting Save Page as MHTML and Enable it,then try to download the page again.Then use this co

Categories : C#

jQuery loads cached file inside ajax success function
try to use a simple cachebusting technique, like $('#pdf_placeholder embed') .attr('src', 'output/my_file.pdf?v=' + Math.random()); this will always invalidate the cache for the pdf

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.