Search Results

Search found 3977 results on 160 pages for 'filename'.

Page 15/160 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • What is Best way to obtain filename for HTML FILE Uploading on forms?

    - by CitadelCSAlum
    I need to obtain the String for the file that is being uploaded from forms to store in the database. I am using the usual form input file element input type="file" name="some_name" I found a couple JS scripts that allow me to do useless things like display the string in a dialog box, etc. I need this as an element on the request object or as a hidden field on my page when the form is posted.

    Read the article

  • Can I use a filehandle instead of a filename for creating DBM files?

    - by Dancrumb
    I'm using MLDBM to persist some Perl data structures and I'm wondering if there's an alternative to the following: tie %hash, "MLDBM", $dbm_file, O_CREAT | O_RDWR, 0644; Primarily, I'd like to be able to use STDOUT, rather than a known file name. This could then be redirected to a file on the shell-side. I've been searching with keywords like "tie", "DBM" and "filehandle", but the hits tend to talk about tying filehandles to things, as opposed to things to filehandles. Any suggestions?

    Read the article

  • HTML/Javascript: Is it possible to remember the filename from a fileupload field ONLY and then later

    - by Pieter Breed
    I have a HTML file upload field from which I'm reading the file name of the file that the user specifies. The actual contents of the file is never uploaded. At a later stage, is it possible to construct a link using this file name information so that if the user clicks on this link, the original file is launched into a new browser window? If not, what are the reason for disallowing this behaviour? The purpose of such a feature is to store links to documents that are available on a mapped local drive or a network share.

    Read the article

  • require file use dirname(__FILE__) or just requre filename?

    - by user285020
    I have a file at lib directory in my rails project. like this a (directory) a1 a2 a.rb when I in a.rb require a1. require 'a/a1' it will warn me /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- a/a1 (MissingSourceFile) but use dirname(FILE), it work. require File.dirname(__FILE__) + '/a/a1 why?

    Read the article

  • Does anyone know what is the 32 character string before the product image filename in Magento ?

    - by Daniel Higgins
    I ask this question, since I am trying to get the images I have just copied from Domain A to work in Domain B, (which is using the same database). http://DOMAIN_A/magento/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/b/0/b0041-1.jpg I think knowing what the 32 character string is, which help me find a good explanation why the images are not being found in the front or backend of Magento after reinstall on DOMAIN B. RE: Magento version 1.4.0.1

    Read the article

  • Rails - Rendering a Partial without having to use "_" in front of the filename?

    - by bluedevil2k
    How do I render a partial without having to supply the "_" in front of the file name? Is there a parameter I can call to not use it? This problem popped up using RABL and Backbone - using RABL requires me to have a file in my views like "index.json.rabl". But, when I use embed the JSON right on the page load (as is usual with Backbone), I'm required to call the file "index.json.rabl". These 2 files are the exact same thing, just required to have different names. I'm looking to use just 1 file, "index.json.rabl" and force the render() function to look for that file name, without the "".

    Read the article

  • Notepad switches

    - by Homer
    What command line switches exist for Notepad? I found a few: /A <filename> opens file as ansi /W <filename> opens file as unicode /P <filename> prints filename Are there others?

    Read the article

  • How to send Content-Disposition headers in apache for ALL files?

    - by user37900
    I have seen similar questions, but the answers currently posted do not work for me. I am trying to get all files to prompt user to download but .html and .jpg files are still being displayed. here is what I have in my httpd.conf <Location /testfiles> SetEnvIf Request_URI "^.*/([^/]*)$" FILENAME=$1 Header set "Content-disposition" "attachment; filename=%{FILENAME}e" UnsetEnv FILENAME </Location> What am i doing wrong ? Many thanks

    Read the article

  • Download And Install apk from a link.

    - by rayman
    Hi, I`am trying to download and install an apk from some link, but for some reason i get an exception. I have one method downloadfile() which downloading the file and a call to and installFile() method, which supposed to install it in the device. some code: public void downloadFile() { String fileName = "someApplication.apk"; MsgProxyLogger.debug(TAG, "TAG:Starting to download"); try { URL u = new URL( "http://10.122.233.22/test/someApplication.apk"); try { HttpURLConnection c = (HttpURLConnection) u.openConnection(); try { c.setRequestMethod("GET"); c.setDoOutput(true); try { c.connect(); FileOutputStream f = context.openFileOutput(fileName, context.MODE_WORLD_READABLE); try { InputStream in = c.getInputStream(); byte[] buffer = new byte[1024]; int len1 = 0; int totsize = 0; try { while ((len1 = in.read(buffer)) > 0) { totsize += len1; f.write(buffer, 0, len1);// .write(buffer); } } catch (IOException e) { e.printStackTrace(); } f.close(); MsgProxyLogger.debug(TAG, TAG + ":Saved file with name: " + fileName); InstallFile(fileName); } catch (IOException e) { e.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } } catch (ProtocolException e) { e.printStackTrace(); } } catch (IOException e) { e.printStackTrace(); } } catch (MalformedURLException e) { e.printStackTrace(); } } and this is the install file method: private void InstallFile(String fileName) { MsgProxyLogger.debug(TAG, TAG + ":Installing file " + fileName); String src = String.format( "file:///data/data/com.test/files/", fileName); Uri mPackageURI = Uri.parse(src); PackageManager pm = context.getPackageManager(); int installFlags = 0; try { PackageInfo pi = pm.getPackageInfo("com.mirs.agentcore.msgproxy", PackageManager.GET_UNINSTALLED_PACKAGES); if (pi != null) { MsgProxyLogger.debug(TAG, TAG + ":replacing " + fileName); installFlags |= PackageManager.REPLACE_EXISTING_PACKAGE; } } catch (NameNotFoundException e) { } try { // PackageInstallObserver observer = new PackageInstallObserver(); pm.installPackage(mPackageURI); } catch (SecurityException e) { //!!!!!!!!!!!!!here i get an security exception!!!!!!!!!!! MsgProxyLogger.debug(TAG, TAG + ":not permission? " + fileName); } this is the exception details: "Neither user 10057 nor current process has android.permission.INSTALL_PACKAGES". and i have set in my main app that permission in the manifest. anyone has any idea? thanks, ray.

    Read the article

  • How to check file exists and rename in perl

    - by Disco
    I'm kinda newbie to perl and looking for a script that will handle file moving. #!/usr/bin/perl -w $filename = 'DUMBFILE'; $destination = '/some/location/'; if (-e $destination + $filename) { print "File Exists ! Renaming .."; move ('/tmp/' + $filename, $destination + $filename + '.1'); } else { move ('/tmp/' + $filename, $destination + $filename); } I'm able to rename it to 1, but i want to be renamed incrementally, like if file.1 exists, rename to .2, and .3 if .2 exists. That should be easy to do, but i'm kinda lost ..

    Read the article

  • Vaadin: Downloaded file has whole path as file name

    - by javydreamercsw
    I have a download action implemented on my Vaadin application but for some reason the downloaded file has the original file's full path as the file name. Any idea? You can see the code on this post. Edit: Here's the important part of the code: package com.bluecubs.xinco.core.server.vaadin; import com.bluecubs.xinco.core.server.XincoConfigSingletonServer; import com.vaadin.Application; import com.vaadin.terminal.DownloadStream; import com.vaadin.terminal.FileResource; import java.io.*; import java.net.URLEncoder; import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.CRC32; import java.util.zip.CheckedInputStream; /** * * @author Javier A. Ortiz Bultrón<[email protected]> */ public class FileDownloadResource extends FileResource { private final String fileName; private File download; private File newFile; public FileDownloadResource(File sourceFile, String fileName, Application application) { super(sourceFile, application); this.fileName = fileName; } protected void cleanup() { if (newFile != null && newFile.exists()) { newFile.delete(); } if (download != null && download.exists() && download.listFiles().length == 0) { download.delete(); } } @Override public DownloadStream getStream() { try { //Copy file to directory for downloading InputStream in = new CheckedInputStream(new FileInputStream(getSourceFile()), new CRC32()); download = new File(XincoConfigSingletonServer.getInstance().FileRepositoryPath + System.getProperty("file.separator") + UUID.randomUUID().toString()); newFile = new File(download.getAbsolutePath() + System.getProperty("file.separator") + fileName); download.mkdirs(); OutputStream out = new FileOutputStream(newFile); newFile.deleteOnExit(); download.deleteOnExit(); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } in.close(); out.close(); final DownloadStream ds = new DownloadStream( new FileInputStream(newFile), getMIMEType(), fileName); ds.setParameter("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "utf-8")); ds.setCacheTime(getCacheTime()); return ds; } catch (final FileNotFoundException ex) { Logger.getLogger(FileDownloadResource.class.getName()).log(Level.SEVERE, null, ex); return null; } catch (IOException ex) { Logger.getLogger(FileDownloadResource.class.getName()).log(Level.SEVERE, null, ex); return null; } } } I already debugged and verified that fileName only contains the file's name not the whole path.

    Read the article

  • Files and filegroups sql server 2005

    - by Dhivagar
    Can we move default file to another filegroup. sample code is given below Sample code create database EMPLOYEE ON PRIMARY ( NAME = 'PRIMARY_01', FILENAME = 'C:\METADATA\PRIM01.MDF', SIZE = 5 MB , MAXSIZE =50 MB, FILEGROWTH = 2 MB), ( NAME = 'SECONDARY_02', FILENAME = 'C:\METADATA\SEC02.NDF' ), FILEGROUP EMPLOYEE_dETAILS ( NAME = 'EMPDETILS_01', FILENAME = 'C:\METADATA\EMPDET01.NDF', SIZE = 5 MB , MAXSIZE =50 MB, FILEGROWTH = 2 MB), ( NAME = 'EMPDETILS_02', FILENAME = 'C:\METADATA\EMPDET02.NDF', SIZE = 5 MB , MAXSIZE =50 MB, FILEGROWTH = 2 MB) LOG ON ( NAME = 'TRANSACLOG', FILENAME ='c:\METADATA\TRAS01.LDF', SIZE = 5 MB , MAXSIZE =50 MB, FILEGROWTH = 2 MB ) now i want to move the FILENAME = 'C:\METADATA\SEC02.NDF' from deault primary file to the FILEGROUP EMPLOYEE_dETAILS ? need assist ??

    Read the article

  • C++ - Opening a file inside a function using fopen. (Noob problem)

    - by Josh
    I am using Visual Studio 2005 (C++). I am passing a string into a function as a char array. I want to open the file passed in as a parameter and use it. I know my code works to an extent, because if I hardcode the filename as the first parameter it works perfectly. I do notice if I look at the value as a watch, the value includes the address aside the string literal. I have tried passing in the filename as a pointer, but it then complains about type conversion with __w64. As I said before it works fine with "filename.txt" in place of fileName. I am stumped. void read(char fileName[50],int destArray[MAX_R][MAX_C],int demSize[2]) { int rows=0; int cols=0; int row=0; int col=0; FILE * f = fopen(fileName,"r"); ...

    Read the article

  • C++ - Opening a file inside a function using fopen

    - by Josh
    I am using Visual Studio 2005 (C++). I am passing a string into a function as a char array. I want to open the file passed in as a parameter and use it. I know my code works to an extent, because if I hardcode the filename as the first parameter it works perfectly. I do notice if I look at the value as a watch, the value includes the address aside the string literal. I have tried passing in the filename as a pointer, but it then complains about type conversion with __w64. As I said before it works fine with "filename.txt" in place of fileName. I am stumped. void read(char fileName[50],int destArray[MAX_R][MAX_C],int demSize[2]) { int rows=0; int cols=0; int row=0; int col=0; FILE * f = fopen(fileName,"r"); ...

    Read the article

  • how to open another window and close the window that calls it

    - by user225269
    I have this code in userpage.php: <script langauge="JavaScript"><!-- function newWindow(fileName,windowName) { msgWindow=window.open(fileName,windowName); } //--></script> <a href="javascript:newWindow('1.html','window1')">Logout</a> And this code at index.php: <script language="JavaScript"><!-- function newWindow(fileName,windowName) { msgWindow=window.open(fileName,windowName); } function replaceURL(fileName) { newWindow(fileName,'window2'); self.close(); } //--></script> What Im trying to do is to call another window that show index.php. Calling it with the userpage.php. But the script doesn't close the window that calls it. Its a logout link. Because when I press back button after logging out. I end up seeing the page which only the user that has logged in can access

    Read the article

  • Inconsistent Behavior From Declared DLL Function

    - by Steven
    Why might my GetRawData declared function return a correct value when called from my VB.NET application, but return zero when called from my ASP.NET page? The code is exactly the same except for class type difference (Form / Page) and calling event handler (Form1_Load, Page_Load). Note: In the actual code, #DLL# and #RAWDATAFILE# are both absolute filenames to my DLL and raw data file respectively. Note: The DLL file was not created by Visual Studio. Form1.vb Public Class Form1 Declare Auto Function GetRawData Lib "#DLL#" (ByVal filename() As Byte, _ ByVal byteArray() As Byte, _ ByVal length As Int32) As Int32 Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load Dim buffer(10485760) As Byte Dim msg As String, length As Integer = 10485760 Dim filename As String = "#RAWDATAFILE#" length = GetRawData(Encoding.Default.GetBytes(filename), buffer, length) Default.aspx.vb Partial Public Class _Default Inherits System.Web.UI.Page Declare Auto Function GetRawData Lib "#DLL#" (ByVal filename() As Byte, _ ByVal byteArray() As Byte, _ ByVal length As Int32) As Int32 Protected Sub Page_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Load Dim buffer(10485760) As Byte Dim msg As String, length As Integer = 10485760 Dim filename As String = "#RAWDATAFILE#" length = GetRawData(Encoding.Default.GetBytes(filename), buffer, length)

    Read the article

  • Can't download file in IE7 but there isn't any problem in Firefox, Chrome, etc..?

    - by levhita
    I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this: $MimeType = new MimeType(); $mimetype = $MimeType->getType($filename); $basename = basename($filename); header("Content-type: $mimetype"); header("Content-Disposition: attachment; filename=\"$basename\""); header('Content-Length: '. filesize($filename)); if ( @readfile($filename)===false ) { header("HTTP/1.0 500 Internal Server Error"); loadErrorPage('500'); } Downloads works as charm in any Browser except IE, I have seen problems related to 'no-cache' headers but I don't send anything like that, they talk about utf-8 characters, but there is not any utf-8 characters(and the $filename has not any utf-8 characteres neither).

    Read the article

  • C++ open() fails for no apparant reason

    - by jondoe
    The following code: char filename[64]; ifstream input; cout << "Please enter the filename: " << endl; cin >> filename; input.open(filename); if (!input.is_open()) { cout << "Opening file " << filename << " failed." << endl; exit(1); } fails, it enters the if() and exits. What could possibly be the cause for this? I'm using Microsoft Visual C++. When I hardcoded the filename as a constant it instead ended up garbled: http://pici.se/pictures/CNQEnwhgo.png Suggestions?

    Read the article

  • Web Application : How to upload multiple images at a time

    - by SAMIR BHOGAYTA
    //First add image control into the web form how many you want to upload images at a time //Add one button //Write the below code into the button_click event if (FileUpload1.HasFile) { string imagefile = FileUpload1.FileName; if (CheckFileType(imagefile) == true) { Random rndob = new Random(); int db = rndob.Next(1, 100); filename = System.IO.Path.GetFileNameWithoutExtension(imagefile) + db.ToString() + System.IO.Path.GetExtension(imagefile); String FilePath = "images/" + filename; FileUpload1.SaveAs(Server.MapPath(FilePath)); objimg.ImageName = filename; Image1(); if (Session["imagecount"].ToString() == "1") { Img1.ImageUrl = FilePath; ViewState["img1"] = FilePath; } else if (Session["imagecount"].ToString() == "2") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = FilePath; ViewState["img2"] = FilePath; } else if (Session["imagecount"].ToString() == "3") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = ViewState["img2"].ToString(); Img3.ImageUrl = FilePath; ViewState["img3"] = FilePath; } else if (Session["imagecount"].ToString() == "4") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = ViewState["img2"].ToString(); Img3.ImageUrl = ViewState["img3"].ToString(); Img4.ImageUrl = FilePath; ViewState["img4"] = FilePath; } else if (Session["imagecount"].ToString() == "5") { Img1.ImageUrl = ViewState["img1"].ToString(); Img2.ImageUrl = ViewState["img2"].ToString(); Img3.ImageUrl = ViewState["img3"].ToString(); Img4.ImageUrl = ViewState["img4"].ToString(); Img5.ImageUrl = FilePath; ViewState["img5"] = FilePath; } } } //execption handling else { lblErrMsg.Visible = true; lblErrMsg.Text = ""; lblErrMsg.Text = "please select a file"; } } //if file extension belongs to these list then only allowed public bool CheckFileType(string filename) { string ext; ext = System.IO.Path.GetExtension(filename); switch (ext.ToLower()) { case ".gif": return true; case ".jpeg": return true; case ".jpg": return true; case ".bmp": return true; case ".png": return true; default: return false; } }

    Read the article

  • Difference between sh file.sh and file.sh

    - by RAS
    I have two questions : What is the difference between executing sh filename.sh and filename.sh? How can I make both of them giving me the same output ? I'm asking this question as right now I'm facing a problem. I'm trying to run a Java + SWT application from terminal. When I do filename.sh, it gives me the desired output. But when I do sh filename.sh or bash filename.sh, it throws me an error : Exception in thread "main" java.lang.NoClassDefFoundError: MainForm/java Caused by: java.lang.ClassNotFoundException: MainForm.java at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: MainForm.java. Program will exit. I know this question is already asked here but I'm still not clear about it. I have gone through the following links : What is the difference between ./ and sh to run a script? Can scripts run even when they are not set as executable? Can anyone help me with this?

    Read the article

  • Bash Script help required

    - by Sunil J
    I am trying to get this bash script that i found on a forum to work. Copied it to text editor. Saved it as script.sh chmod 700 and tried to run it. rootdir="/usr/share/malware" day=`date +%Y%m%d` url=`echo "wget -qO - http://lists.clean-mx.com/pipermail/viruswatch/$day/thread.html |\ awk '/\[Virus/'|tail -n 1|sed 's:\": :g' |\ awk '{print \"http://lists.clean-mx.com/pipermail/viruswatch/$day/\"$3}'"|sh` filename=`wget -qO - http://lists.clean-mx.com/pipermail/viruswatch/$day/thread.html |\ awk '/\[Virus/'|tail -n 1|sed 's:": :g' |awk '{print $3}'` links -dump $url$filename | awk '/Up/'|grep "TR\|exe" | awk '{print $2,$8,$10,$11,$12"\n"}' > $rootdir/>$filename dirname=`wget -qO - http://lists.clean-mx.com/pipermail/viruswatch/$day/thread.html |\ awk '/\[Virus/'|tail -n 1|sed 's:": :g' |awk '{print $3}'|sed 's:.html::g'` rm -rf $rootdir/$dirname mkdir $rootdir/$dirname cd $rootdir grep "exe$" $filename |awk '{print "wget \""$5"\""}' | sh ls *.exe | xargs md5 >> checksums mv *.exe $dirname rm -r $rootdir/*exe* mv checksums $rootdir/$dirname mv $filename $rootdir/$dirname I get the following message.. script.sh: line 11: /usr/share/malware/: Is a directory script.sh: line 11: links: command not found

    Read the article

  • MouseMotionListener inside JTable

    - by Harish
    I am trying to add MouseMotion event to the label and move it based on the dragging of the mouse and make it move along with my mouse.However the mousemotion is very difficult to control making this action not usable. Here is the code import java.awt.Color; import java.awt.Component; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; public class TableTest { public TableTest() { String[] columnNames = { "FileName", "Integer" }; Object[][] data = { { new FileName("AAA.jpg", Color.YELLOW), new Integer(2) }, { new FileName("BBB.png", Color.GREEN), new FileName("BBB.png", Color.GREEN) }, { new FileName("CCC.jpg", Color.RED), new Integer(-1) }, }; DefaultTableModel model = new DefaultTableModel(data, columnNames) { public Class getColumnClass(int column) { System.out.println("column is" + column); return getValueAt(0, column).getClass(); } }; JTable table = new JTable(model); //JTable table = new JTable(data, columnNames); table.setDefaultRenderer(FileName.class, new FileNameCellRenderer()); final JLabel label = new JLabel("TESTING", SwingConstants.CENTER); label.setBackground(java.awt.Color.RED); label.setBounds(450, 100, 90, 20); label.setOpaque(true); label.setVisible(true); label.addMouseMotionListener(new MouseMotionListener() { public void mouseDragged(MouseEvent arg0) { label.setBounds(arg0.getX(), arg0.getY(), 90, 20); } public void mouseMoved(MouseEvent arg0) { // TODO Auto-generated method stub } }); table.add(label); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(table); frame.setSize(800, 600); frame.setLocationRelativeTo(null); frame.setVisible(true); } static class FileNameCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object v, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, v, isSelected, hasFocus, row, column); FileName fn = (FileName) v; setBorder(BorderFactory.createMatteBorder(0, 60, 0, 0, new java.awt.Color(143, 188, 143))); return this; } } static class FileName { public final Color color; public final String label; FileName(String l, Color c) { this.label = l; this.color = c; } public String toString() { return label; } } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new TableTest(); } }); } } I just want to make the label follow the label follow my mouse and the label should be attached to the table.Is there an easy way than this.

    Read the article

  • What should filenames and URLs of images contain for SEO benefit?

    - by Baumr
    We know that good site architecture usually looks like this: example-company.com/ example-company.com/about/ example-company.com/contact/ example-company.com/products/ example-company.com/products/category/ example-company.com/products/category/productname/ Now, when it comes to Google Image search, it is clear that the img alt tag, filename/URL, and surrounding text (captions, headings, paragraphs) have an effect on ranking. I want to ask about the filename of the images that we should use (e.g. product-photo.jpg). ...but first about the URL: Often web developers stick all images in a single folder in the root: example-company.com/img/ — and I have stopped doing that. (I don't want to get into it, but basically, it seems more semantic for images which make up part of the content at each sub-directory) However, when all images appear in a folder, I feel that their filename needs to reflect what they are a bit more than usual, for example: example-company.com/img/example-company-productname-category.jpg It's a longer filename than just product.png, but as long as it's relevant, I see no problem with regards to SEO (unless you're keyword stuffing), and it could even help rank for keywords: "example company" "productname" "category" So no questions there. But what about when we have places images in the site architecture we outlined at the beginning? In other words, what if image URL paths look like this: example-company.com/products/category/productname/productname.jpg My question is, should the URL be kept short like above and only have the "productname" (and some descriptive keywords) as part of it's filename? Or, should it also include the "example-company" and "category"? Like so: example-company.com/products/category/productname/example-company-category-productname.jpg That seems much longer, and redundant when we look at the URL, but here are a few considerations. Images are often downloaded onto computers, and, to the average user, they lose their original URL and thus — it isn't clear where they came from. Also, some social networks, forums, and other platforms leave the filename intact when uploaded. (Many others rewrite it, for example, Pinterest and Facebook.) Another consideration, will this really help (even if ever so slightly) rank in Google Image Search, or at least inform Google that the product is something specific to the "example-company"? For example, what if this product can only be bought at this store and is the flagship product? In addition to an abundance of internal links to this product page, would having the "example company" name and "category" help it appear in "example company" searches? In other words, is less more?

    Read the article

  • where to define variable for a for each loop?

    - by David
    can you please advise me why my first code attempt didn't work : public void listAllFiles() { for(String filename : files) { int position = 0; System.out.println(position + ": " + filename); position = position + 1; } } it kept printing position at 0 without iterating position but it seems to work after i did it this way: public void listAllFiles() { int position = 0; for(String filename : files) { System.out.println(position + ": " + filename); position = position + 1; } } I don't understand why the position + 1 was not being executed, is it because we are not meant to define variables inside for loops or am i missing something in my code.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >