Uploading Image Via Admin Menu?

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Uploading Image Via Admin Menu?

minnieadkins
There's never much action in here.

Here's a question for all you php guys out there. Here's what I want. Let's say I create a simple administration menu for someone to Add/Edit/Delete a record/item from a database. Now in the add function, let's say I want to store a URL to a image. Rather than having to go in and FTP that image up on the server, how could a person create a 'Browse' button and find that image on your harddrive, then create a script to upload the image to the server?

Just wondering how to do it, or if it could be done easily. I assume it would be a fairly simple process, but I've never attempted it, and I figured someone out there has. Let me know what are your thoughts and past experiences.

Reply

vujsa
Well, the good news is that the PHP manual has a special section just for this topic.

In fact, the example they give is pretty much the best way to do it as well.

http://us2.php.net/manual/en/features.file-upload.php

All you really need to do is copy and paste the example and fill in your information for it. Of course, extra features can be obtained by using other functions in the script.

Hope this helps, if you need more information or more resouces, let me know and I'll see if I can help.

vujsa

Reply

Hercco
Handling file uploads is much easier that you might think. Actually, if you can process typical textual form data, you should be able to process files too.

In exactly similar manner than in a, say post form, the file information exists in a superglobal array $_FILES, just like the superglobals $_POST and $_GET. The array contains the temporary filename for the file from which you can move it to your directory of choise. And that's about it. Then you are free to do whatever processing you wish, such as resizing the image and so on.

Although the file uploads is really easy to do in itself you should pay attention to some issues especially if you are allowing uploads from anyone (so not just your own admin panel that only you have access). In all cases there are limitations on filesize: in PHP a certain maximum size for an uploaded file is set and it can be a real limitation for large images. So if your upload fails you know what to check first.

But more importantly you should pay attention to security... remember you are allowing file uploads to the server! So it is essential that you check that the data is what it is supposed to be and make sure that no malicious person gets his own program code to server. So if you expect images accept only images.

 

 

 


Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : uploading, image, admin, menu

  1. How To Design The Popup Menu Item Using Javascript(2)
    (0)
  2. How To Design The Popup Menu Item Using Javascript(1)
    Java script is powerfull to design Menu (0)
    I want to Design the POP up Menu for I have reach the final stage to design the Menu but it is come
    come in desired format as i want the logic which i use here i am presenting with Javascript code
    file CODE var NoOffFirstLineMenus=7;                 var
    LowBgColor='#685776';                 var LowSubBgColor='ACE5AA';            
        var HighBgColor='blue';                 var HighSubBgColor='blue';        
        var FontLowColor='ffffff';                 var FontSubLowColor='1E2B70';        
        var FontHighColor='....
  3. 12 Javascript Image Galleries
    (0)
    While I was looking around and searching for a good online gallery for a client of mine, i stop by
    into this article 12 Javascript Image Galleries that offers some of the better Image Galleries i
    found. All of these Image Galleries are Javascript, CSS and Ajax based solutions, so be careful and
    take in mind that if Javascript is disable they will not work. Aditionally, some of them are server
    side -PHP- based also. If someone is in a hurry and need to check them out here is the 12 Image
    Galleries collection posted in the article: (E)2 Photo Gallery Made With Mootoo....
  4. Astahost Is Dead
    Still trying to contact Admin (10)
    Dear AstaHost... I voted for you. Out of all the other candidates, I said "AstaHost is the
    smartest. I'll put them in charge of my website. They hold lots of promise." But since then,
    AstaHost, you've broken your election promise. Yes. Broken. Remember when you said...
    QUOTE(QpaQue @ Jan 24 2005, 12:39 AM) Unlike our competitors, WE DO NOT :- 5> Take long time to
    approve accounts. Well, I've been waiting for longer than a week now to get my account
    activated. Unlike other members, I read the rulebook. I contributed to have 30 credits well in advan....
  5. Access Denied As Admin On Xp, Services Troubles
    (4)
    I've had an access denied message on various things, like ending services. Other services (Also
    anti-virus/non-m$) take a long time to end, or reset themselves to Automatic when I set
    Disabled/Manual. Panda and Webroot Spy Sweeper re-add themselves to Services and startup even when
    I delete them with HJT. I'd be happy to unistall them if I knew of better AV, which doesn't
    need any startup items......
  6. Image Problems With Windows 2000
    (10)
    Hi, since a while i got two problems related with images files in my Windows 2000 machine, both are
    very closely related because them happen with Windows Explorer and with Internet Explorer 6. The
    problems are: Windows Explorer Thumbnails Preview : The problem with this option of the View menu
    is that it doesn't show any thumbnail preview of any image in my hole computer, i verify this
    problem for jpg, jpeg, gif, png or bmp files, but it works fine and generate the thumbnail previews
    for html files. IE Save as... dialog and JPG files extension : Every time that....
  7. Dynamic Php Image And Better Php Code Question
    (10)
    Im working on a dynamic image, can i put 2 images in same dynamic image, and can i make this code
    shorter? if ( $goal == 31 ) { $xp2 = ('14833'); } elseif ( $goal == 32 ) { $xp2 =
    ('16456'); } elseif ( $goal == 33 ) { $xp2 = ('18247'); } elseif ( $goal == 34 ) {
    $xp2 = ('20224'); } elseif ( $goal == 35 ) { $xp2 = ('22406'); } elseif ( $goal ==
    36 ) { $xp2 = ('24815'); } elseif ( $goal == 37 ) { $xp2 = ('27473'); } elseif (
    $goal == 38 ) { $xp2 = ('30408'); } elseif ( $goal == 39 ) { $xp2 = ('33648')....
  8. Dynamic Gd Image
    (2)
    I dont know if someone already made a topic like this, however it's not hard to understand if
    you can php, as many know we need to start a php script with CODE and end with CODE ?>
    to make a image you need a image type, I choos .png because its much cleaner then .jpg CODE
    header("Content-type: image/png"); for the background for the image we need this code CODE
    $image = imagecreatefrompng("http://www.imagefilez.com/out.php/i252132_Userbar.png"); if we wont
    a text in the image we need a font color, we get our font color from HEX values ....
  9. Stage.scalemode
    When my image scale down my stage doesn't follow. How to make it w (1)
    Well I have made a movie where the intro is an image (812 x 458). When it reaches around frame 20
    (after all the motion and tweening) I scaled down the image (541 x 305) and other effects will take
    place around this size only. The problem I'm facing is that the stage doesn't scale down or
    change size when the image has. Can somebody help me? You can actually visit LV UK Intro Page
    intro movie. That's what I'm trying to do.....
  10. Uploading More Than 30 Files In Less Than 10 Clicks?
    (5)
    Hey! is it possible to upload lots of files fast, and to a specefic folder? I am sure you guys are
    going to tell me "use" the FTP tool.. But I have no idea how to use it =/....
  11. Image Popup On Mouseover
    (23)
    I need a script that does this: Lets say I have form with options...you surely know what that is...
    CODE Who do you wanna race?           Derbi Senda 50      Honda NS 50 R      Suzuki ZR
    50      Yamaha DT 50 MX      Aprilia RS 50      - ?         When i put my mouse over
    one of them i want a picture of bike on which your mouse is on to pop up... I hope you understand
    what i mean...i can't rephrase it to be more meaningful...i tried /wink.gif"
    style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />....
  12. Is The Core Image Possible On Radeon 9200 Mobile?
    (0)
    I use ibook G4 with OSX 10.4.11.. It can operate dash board well. But I knew that my ibook
    didn't support core image. Does anyone know where the CI support driver is? ....
  13. My Background Image
    My BG Image (7)
    do u like this image i made on photoshop cs3! i u can use it a you wallpaper lol i have!
    vmkrightpoint!....
  14. Creating Flash Image/slideshow
    (2)
    Hi, is there any simple way to create a Flash (or any animated) movie/slideshow similar to this one
    ? I want to have a similar effect on one of the myspace accounts I'm helping a user create. I
    want to avoid using Adobe Flash if a website or some free program can do this job for me. Thanks.....
  15. Need Help With JS/CSS Dropdown Menu
    (11)
    Hey guys, I'm helping out a friend in designing a site for his business and got stuck
    with JS/CSS Dropdown menu. Searching around I found one of the easiest to implement scripts at
    Dynamic Drive . I managed to implement the script partially, i.e. got the top menu showing up.
    Looked good so far. Here's the screenshot: After defining the menu divs, you're
    supposed to call the script that performs the dropdown action using a code like this: CODE
    cssdropdown.startchrome("name_of_main_menu_div"); When I call the function, my page lay....
  16. Is It A Good Practice To Store Image Or Other Binary Files Directly In A Mysql Database
    (4)
    Hello to all of you beautifull people out there, I am new to MySQL, i just wanted to know if its a
    good practice to directly store images and other binary files in a MySQL database. Any one with
    help? Thanks....
  17. Help: XP Pro Admin Account Deleted! Only Guest Access
    (41)
    HELP Administrator account deleted, need help loggin in to my laptop!!! WIN XP PRO Service Pack 2?
    My friend was using my laptop and she says she has no idea what she did but she somehow deleted my
    account (the only account) so now i can only login as a guest andI have no access to my music
    pictures. programs, homework nothing, and I have a Toshiba Portege' laptop, it has no floppy
    disk or cd drive no internet connection, so i have no idea how to fix this, I tried the ctrl+alt+del
    trick but it will not work the default admin, has a password and i have no idea what it....
  18. Bypassing Filtered Sites
    Getting around your admin (29)
    I decided today that i was sick of my filter at school. Usually i would abide the rules but today
    the fillter whent too far, looking for people who cheated in the Olympic games and it wouldn't
    even let me search the topic. Bypassing was the only way. it just pisses me off that the tool that
    they have given us is so restricted that it is usless. So im sending a big F you /mad.gif"
    style="vertical-align:middle" emoid=":angry:" border="0" alt="mad.gif" /> to the people who made
    Bess. If you have a good unblocked proxy list it here.....
  19. Need To Hack An Admin Account On Xp... No Problem!
    It's so easy to hack an account you'll be amazed (61)
    Well recently one of my good girl that is a friend got a laptop from her dad. Her dad does websites
    so the laptop was new and worked fine, but needed to be defraged. The one problem, her nor her dad
    knew the admin password. I told her to post her question on Trap 17 and it got answered with in
    minutes. All you have to do is these few steps: 1. Reboot 2. Before the windows logo comes up press
    F11 (Just start clicking it over and over again until the windows logo comes up.) 3. Just sit and
    let it do it's thing and when the login screen comes up click on the Admin icon....
  20. Add Hibernate To The Shutdown Menu
    (7)
    I'm pretty sure it involves a registry edit, which is fine if anyone can find it for me, but I
    want to add the Hibernate option to the options on the Shutdown menu. For reference, I have Windows
    XP Pro SP2. I know that if I hold down shift the Standby button changes to Hibernate, but I would
    prefer to have Hibernate be a constant fourth option to the left of the Stansby button. I know
    it's possible because I've seen it done before. Thanks, ~Viz....
  21. Dynamically Change The Background Image On Mouse Effects!
    easy code to dynamically change the background image (3)
    stun ur visitor with a new bg image on every mouse click of his! easy code to dynamically change
    the background image. Copied from http://www.scriptworm.com/scriptengine/visit.php?id=30296
    QUOTE control the background image using the links on your site. control the color using
    onMouseOver, onMouseOut, onClick, and a combination of all of them. place the code below between
    the and tags within the HTML page where you want the link to appear. edit the link text provided to
    point at the page you would like to open. Option 1: use this to change the background ....
  22. Uploading Image File Through JSP Code To Server
    (9)
    I have to upload images from client side to server side, without using input tag or browseing of
    file. I know the absolute path of file in client side. And that file I want to shift to server with
    JSP code or any servlet code. I have done uploading through servlet to the server with input tag
    and type is file . Servlet code : CODE import com.oreilly.servlet.MultipartRequest;
    import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public
    class UploadPhoto extends HttpServlet { public void doPost(HttpServletRequest req, Ht....
  23. :d Coke-cola Machine Debug Menu
    (18)
    I learned most of this by myself, but I didn't really know how to explain. so I'm quoting
    off of this site >> PLA Fourms QUOTE Coke Machine Debug Menu Published on 10/09/03 at
    15:05:37 CST by Kyint   PREFACE Coke vending machines are everywhere. They're
    getting more and more like regular computers with LEDs that show little "ICE COLD" messages and
    whatnot. Well, there's a lot more to those little built-in computers than you may think.
    Included in the low-level operating system that these babies run on is an actual debug menu that
    gives ....
  24. How To Make A Good Sig Image!
    (6)
    Hello all. I am going to tell you how to make a good sig in Photoshop. Okay lets get started:
    Well first you need to start up photoshop /tongue.gif' border='0' style='vertical-align:middle'
    alt='tongue.gif' /> . Then go to FILE->NEW And enter: 360 by 140 or what ever size you wish to
    use. Click D to set ever thing to defualt. Then click on FILTER-> RENDER-> CLOUDS Take out your
    fav brush, i suggest a grunge brush. Start by laying a layer in black. Create a new layer and lay
    down some white brushes. Repeat till your happy. Merge all Layers. Click CTRL L an....
  25. Image Resizer Power Toy
    resize your images with a right click. (2)
    Microsoft Image Resizer Power toy With Microsoft Image Resizer Power toy, you can resize your
    images with a right click. First download Microsoft Image Resizer Power toy, from “Microsoft Power
    Toys for Windows XP” homepage. Please Click below URL
    http://www.microsoft.com/windowsxp/downloa...ppowertoys.mspx About Microsoft Power Toys: Power
    Toys are additional programs from Microsoft developers, but Microsoft does not support them. After
    downloading and installing Microsoft Image Resizer, “Resize Pictures” context menu will add to right
    click menu. When you right-cli....
  26. Anyone Know Of Any Good Image Editing Software?
    for windows. (24)
    so.. does anyone know of any good image editing software? something similar to photoshop i guess or
    psp? that has a lot of options and things to do ......
  27. How To Save A Image In Pdf File And Download It?
    Programming script need hepl. (10)
    Can anyone tell how to save an image into a PDF file and download it without need to save it on the
    server? Thanks. All sugesstions are welcome! Wrong section. Topic moved to Software > Graphics &
    Web Design. ....
  28. Coppermine Random Image Script
    (6)
    hi i need a script to display random image of coppermine on my index....
  29. How To Mount A Cd Image
    (13)
    Ok First u need to hav a image of a FIle . Images are actually CD exact copies. To run them u dun
    need a cd drive but instead we can Emulate them . U can download Emulators such as Deamon tools
    Alcohol 120% Nero Daemon tools is one of my preffered emulator coz its not resource eater. So i
    will tell u how to mount image in Daemon tools What are Images? Images are of the format .nrg, iso,
    .cue,.bin. These are the plpular image files. Run Daemon Tools after Installing. An icon wil appear
    in the toolbar. Right click on the icon There will be an option to mount image. Cl....
  30. IE6 display:block hides other image BUG
    (1)
    Hi everyone, I have a problem. I have two images, and one has the 3px IE bug. Turning this to a
    block level element fixes it but then an image to the right disapears. Another fix I have tried is
    an IE hack with -3px margin which makes the bottom line up but then the top is off. Here is the
    CSS in question.
    code:--------------------------------------------------------------------------------#masthead {
    width:100%; background-color:#4F6DB1; background-image: url(../images/layout/blg_gradient.jpg);
    background-repeat:repeat-x; } #logo { position:relative; z-in....

    1. Looking for uploading, image, admin, menu






*SIMILAR VIDEOS*
Searching Video's for uploading, image, admin, menu
Similar
How To Design The Popup Menu Item Using Javascript(2)
How To Design The Popup Menu Item Using Javascript(1) - Java script is powerfull to design Menu
12 Javascript Image Galleries
Astahost Is Dead - Still trying to contact Admin
Access Denied As Admin On Xp, Services Troubles
Image Problems With Windows 2000
Dynamic Php Image And Better Php Code Question
Dynamic Gd Image
Stage.scalemode - When my image scale down my stage doesn't follow. How to make it w
Uploading More Than 30 Files In Less Than 10 Clicks?
Image Popup On Mouseover
Is The Core Image Possible On Radeon 9200 Mobile?
My Background Image - My BG Image
Creating Flash Image/slideshow
Need Help With JS/CSS Dropdown Menu
Is It A Good Practice To Store Image Or Other Binary Files Directly In A Mysql Database
Help: XP Pro Admin Account Deleted! Only Guest Access
Bypassing Filtered Sites - Getting around your admin
Need To Hack An Admin Account On Xp... No Problem! - It's so easy to hack an account you'll be amazed
Add Hibernate To The Shutdown Menu
Dynamically Change The Background Image On Mouse Effects! - easy code to dynamically change the background image
Uploading Image File Through JSP Code To Server
:d Coke-cola Machine Debug Menu
How To Make A Good Sig Image!
Image Resizer Power Toy - resize your images with a right click.
Anyone Know Of Any Good Image Editing Software? - for windows.
How To Save A Image In Pdf File And Download It? - Programming script need hepl.
Coppermine Random Image Script
How To Mount A Cd Image
IE6 display:block hides other image BUG
advertisement




Uploading Image Via Admin Menu?