Commit 78fccc95 authored by Thomas's avatar Thomas
Browse files

Fix issue #810 - Wrong preview picture on share from another app

parent fdc2cb07
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1848,7 +1848,6 @@ public class Helper {
                if (responseCode == HttpURLConnection.HTTP_OK) {
                    String fileName = "";
                    String disposition = httpURLConnection.getHeaderField("Content-Disposition");

                    if (disposition != null) {
                        // extracts file name from header field
                        int index = disposition.indexOf("filename=");
@@ -1858,8 +1857,13 @@ public class Helper {
                        }
                    } else {
                        // extracts file name from URL
                        try {
                            URL downLoadUrlTmp = new URL(downloadUrl);
                            fileName = downLoadUrlTmp.getPath().replace("/","_");
                        }catch (Exception exception) {
                            fileName = downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1);
                        }
                    }
                    fileName = FileNameCleaner.cleanFileName(fileName);
                    // opens input stream from the HTTP connection
                    InputStream inputStream = httpURLConnection.getInputStream();