Users uploading pictures

Discussion in 'Javascript' started by C.Joseph Drayton, May 5, 2006.

  1. Hi All,

    I have a web site I am developing, and have a question. I would like
    members to be able to upload pictures.

    Do you think they should be saved as individual files or should they be
    put in an MySQL database? Which would you recommend, and do you have any
    sample code for accomplishing this?

    Ciao . . . C.Joseph

    And on the seventh day God said,
    "I will rest . . . Murphy take over."
    C.Joseph Drayton, May 5, 2006
    #1
    1. Advertising

  2. C.Joseph Drayton

    Randy Webb Guest

    C.Joseph Drayton said the following on 5/5/2006 9:25 AM:
    > Hi All,
    >
    > I have a web site I am developing, and have a question. I would like
    > members to be able to upload pictures.
    >
    > Do you think they should be saved as individual files or should they be
    > put in an MySQL database? Which would you recommend, and do you have any
    > sample code for accomplishing this?


    Whatever the answer, it has nothing to do with Javascript.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, May 5, 2006
    #2
    1. Advertising

  3. C.Joseph Drayton

    Evertjan. Guest

    Randy Webb wrote on 05 mei 2006 in comp.lang.javascript:

    > C.Joseph Drayton said the following on 5/5/2006 9:25 AM:
    >> Hi All,
    >>
    >> I have a web site I am developing, and have a question. I would like
    >> members to be able to upload pictures.
    >>
    >> Do you think they should be saved as individual files or should they be
    >> put in an MySQL database? Which would you recommend, and do you have any
    >> sample code for accomplishing this?

    >
    > Whatever the answer, it has nothing to do with Javascript.


    Unless you are using ASP-Jscript.

    The NGs then (if using ASP, I mean!) to ask are:

    news:microsoft.public.inetserver.asp.general
    or
    news:microsoft.public.inetserver.asp.db


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 5, 2006
    #3
  4. Randy Webb wrote:
    > C.Joseph Drayton said the following on 5/5/2006 9:25 AM:
    >
    >> Hi All,
    >>
    >> I have a web site I am developing, and have a question. I would like
    >> members to be able to upload pictures.
    >>
    >> Do you think they should be saved as individual files or should they be
    >> put in an MySQL database? Which would you recommend, and do you have any
    >> sample code for accomplishing this?
    >>

    >
    > Whatever the answer, it has nothing to do with Javascript.
    >
    >

    Actually it does Randy, I suspect that however I choose to get those
    pictures, I will use a combination of JavaScript and PHP to manipulate
    the pictures.

    Right now I use a combination of JavaScript and PHP to handle the
    existing databases so it would seem the same will be the case for
    picture storage.

    Ciao . . . C.Joseph

    And on the seventh day God said,
    "I will rest . . . Murphy take over."
    C.Joseph Drayton, May 5, 2006
    #4
  5. C.Joseph Drayton

    Randy Webb Guest

    C.Joseph Drayton said the following on 5/5/2006 10:09 AM:
    > Randy Webb wrote:
    >> C.Joseph Drayton said the following on 5/5/2006 9:25 AM:
    >>
    >>> Hi All,
    >>>
    >>> I have a web site I am developing, and have a question. I would like
    >>> members to be able to upload pictures.
    >>>
    >>> Do you think they should be saved as individual files or should they be
    >>> put in an MySQL database? Which would you recommend, and do you have any
    >>> sample code for accomplishing this?
    >>>

    >> Whatever the answer, it has nothing to do with Javascript.
    >>
    >>

    > Actually it does Randy,


    Actually, it doesn't Joseph. There are two parts to what you are doing.
    The What and the How. The How would be PHP and JS, the What would be
    saving images, and saving images on the server - whether as individual
    files or in a MySQL database - has nothing to do with client side
    Javascript.

    If anything, its a PHP/MySQL question and that would be more on how to
    accomplish it instead of what you are trying to accomplish.

    > I suspect that however I choose to get those pictures, I will
    > use a combination of JavaScript and PHP to manipulate the
    > pictures.


    And that is fine, but whether to save them in a Database (which is an
    odd sounding request) or in a file has nothing to do with JS.

    > Right now I use a combination of JavaScript and PHP to handle the
    > existing databases so it would seem the same will be the case for
    > picture storage.


    Your Javascript doesn't handle the databases, PHP does. JS on the client
    may tell PHP to do it but it is PHP doing the work on the server.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, May 5, 2006
    #5
  6. C.Joseph Drayton

    Randy Webb Guest

    Evertjan. said the following on 5/5/2006 10:05 AM:
    > Randy Webb wrote on 05 mei 2006 in comp.lang.javascript:
    >
    >> C.Joseph Drayton said the following on 5/5/2006 9:25 AM:
    >>> Hi All,
    >>>
    >>> I have a web site I am developing, and have a question. I would like
    >>> members to be able to upload pictures.
    >>>
    >>> Do you think they should be saved as individual files or should they be
    >>> put in an MySQL database? Which would you recommend, and do you have any
    >>> sample code for accomplishing this?

    >> Whatever the answer, it has nothing to do with Javascript.

    >
    > Unless you are using ASP-Jscript.


    <pedant>
    ASP uses JScript, not Javascript, which I specified :)
    </pedant>

    But it still has nothing to do with c.l.j and client side scripting.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, May 5, 2006
    #6
  7. C.Joseph Drayton

    Evertjan. Guest

    Randy Webb wrote on 05 mei 2006 in comp.lang.javascript:

    > <pedant>
    > ASP uses JScript, not Javascript, which I specified :)
    > </pedant>


    <rebuff>
    True, however, the two are intermingled in the sense that clientside
    IE javascript is really jscript, and that(!) jscript is spoken here,
    just as the ECMA javascript variant is.
    </rebuff>

    > But it still has nothing to do with c.l.j and client side scripting.


    c.l.j. is not clientside "in browser" only, but certainly clientside
    oriented.

    That is why I pointed to the two ASP NGs.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 5, 2006
    #7
  8. Randy Webb wrote:
    > C.Joseph Drayton said the following on 5/5/2006 10:09 AM:
    >> Randy Webb wrote:
    >>> C.Joseph Drayton said the following on 5/5/2006 9:25 AM:
    >>>
    >>>> Hi All,
    >>>>
    >>>> I have a web site I am developing, and have a question. I would like
    >>>> members to be able to upload pictures.
    >>>>
    >>>> Do you think they should be saved as individual files or should they be
    >>>> put in an MySQL database? Which would you recommend, and do you have any
    >>>> sample code for accomplishing this?
    >>>>
    >>> Whatever the answer, it has nothing to do with Javascript.
    >>>
    >>>

    >> Actually it does Randy,

    >
    > Actually, it doesn't Joseph. There are two parts to what you are doing.
    > The What and the How. The How would be PHP and JS, the What would be
    > saving images, and saving images on the server - whether as individual
    > files or in a MySQL database - has nothing to do with client side
    > Javascript.
    >
    > If anything, its a PHP/MySQL question and that would be more on how to
    > accomplish it instead of what you are trying to accomplish.
    >
    >> I suspect that however I choose to get those pictures, I will
    >> use a combination of JavaScript and PHP to manipulate the
    >> pictures.

    >
    > And that is fine, but whether to save them in a Database (which is an
    > odd sounding request) or in a file has nothing to do with JS.


    Actually it is not really an odd question. I am use to using Clarion
    for web based databases, and I can save them as a blob and have a
    template that converts the JPG to/from blob. This is my first time
    working on a web site where I didn't use Clarion for the database,
    and I am finding that I have to use JavaScript to talk to PHP. I was
    simply trying to find out which would be easier.

    I was given a PHP script to handle the actual file saving, now I
    need to figure out how to access the script via JavaScript.

    >
    >> Right now I use a combination of JavaScript and PHP to handle the
    >> existing databases so it would seem the same will be the case for
    >> picture storage.

    >
    > Your Javascript doesn't handle the databases, PHP does. JS on the client
    > may tell PHP to do it but it is PHP doing the work on the server.
    >


    Ciao . . . C.Joseph

    And on the seventh day God said,
    "I will rest . . . Murphy take over."
    C.Joseph Drayton, May 5, 2006
    #8
  9. C.Joseph Drayton

    Randy Webb Guest

    C.Joseph Drayton said the following on 5/5/2006 1:34 PM:
    > Randy Webb wrote:
    >> C.Joseph Drayton said the following on 5/5/2006 10:09 AM:


    <snip>

    >>> I suspect that however I choose to get those pictures, I will
    >>> use a combination of JavaScript and PHP to manipulate the
    >>> pictures.

    >> And that is fine, but whether to save them in a Database (which is an
    >> odd sounding request) or in a file has nothing to do with JS.

    >
    > Actually it is not really an odd question.


    OK, for me it was. I have always saved them as files and been done with it.

    > I am use to using Clarion for web based databases, and I can save
    > them as a blob and have a template that converts the JPG to/from blob.


    OK.

    > This is my first time working on a web site where I didn't use Clarion
    > for the database, and I am finding that I have to use JavaScript to talk
    > to PHP. I was simply trying to find out which would be easier.


    It would be easier and more efficient to simply save the image files.

    > I was given a PHP script to handle the actual file saving, now I
    > need to figure out how to access the script via JavaScript.


    <form action="saveImageFiles.php" ....>
    <input type="file">
    <input type="submit" value="Upload files">
    </form>

    Then the file gets submitted to the server, no JS needed.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, May 5, 2006
    #9
  10. Randy Webb wrote:
    > C.Joseph Drayton said the following on 5/5/2006 1:34 PM:
    >> Randy Webb wrote:
    >>> C.Joseph Drayton said the following on 5/5/2006 10:09 AM:

    >
    > <snip>
    >
    >>>> I suspect that however I choose to get those pictures, I will
    >>>> use a combination of JavaScript and PHP to manipulate the
    >>>> pictures.
    >>> And that is fine, but whether to save them in a Database (which is an
    >>> odd sounding request) or in a file has nothing to do with JS.

    >> Actually it is not really an odd question.

    >
    > OK, for me it was. I have always saved them as files and been done with it.
    >
    >> I am use to using Clarion for web based databases, and I can save
    >> them as a blob and have a template that converts the JPG to/from blob.

    >
    > OK.
    >
    >> This is my first time working on a web site where I didn't use Clarion
    >> for the database, and I am finding that I have to use JavaScript to talk
    >> to PHP. I was simply trying to find out which would be easier.

    >
    > It would be easier and more efficient to simply save the image files.
    >
    >> I was given a PHP script to handle the actual file saving, now I
    >> need to figure out how to access the script via JavaScript.

    >
    > <form action="saveImageFiles.php" ....>
    > <input type="file">
    > <input type="submit" value="Upload files">
    > </form>
    >
    > Then the file gets submitted to the server, no JS needed.
    >

    Thanks Randy,

    I will give it a try.

    Ciao . . . C.Joseph

    And on the seventh day God said,
    "I will rest . . . Murphy take over."
    C.Joseph Drayton, May 5, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. beethovenofear

    uploading pictures

    beethovenofear, Apr 23, 2006, in forum: HTML
    Replies:
    4
    Views:
    494
    PeterMcC
    Apr 23, 2006
  2. Jeff

    uploading pictures

    Jeff, Mar 25, 2009, in forum: ASP .Net
    Replies:
    6
    Views:
    357
    Alexey Smirnov
    Mar 26, 2009
  3. Martin Raychev
    Replies:
    1
    Views:
    279
    Alvin Bruney [MVP]
    Mar 2, 2004
  4. Z Yao

    Virus Concerns for Uploading Pictures

    Z Yao, Dec 29, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    107
    Z Yao
    Dec 29, 2005
  5. xool

    Uploading Pictures

    xool, Sep 23, 2003, in forum: ASP General
    Replies:
    5
    Views:
    96
    Antonin Foller
    Sep 23, 2003
Loading...

Share This Page