Jump to content

How is a file "uploaded" after the browse-file manager has been triggered


Recommended Posts

I don't know, it seemed simple but it turns out I don't know what to do.

 

I was told that storing a photo as a blob was much harder than simply storing a photo's url or directory location...

 

So... when a file has been selected through the browse-file manager triggered by

 <input type="file"...>

and the file selected is shown, when a person pusehs "upload" what is supposed to happen?

 

Do I need some kind of FTP client to access the server and place the photo in there?

 

It seems so easy in a way like the built in filemanager in cPanel...

 

What am I missing?

 

Thanks for any help.

The php manual is a resource that you should get used to relying on. If you had simply done a search for file uploading in it you would have found this:

 

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

 

Have at it.

Sorry to mark this as unsolved, I had a question

 

Is there such a thing as parmeter binding for file upload?

I would presume not since it is directly done through a file manager and a file can hold theoretically anything... but it is a file eg. not an injection threat... but I'm not sure, can someone shed some light on that?

You should not use the example code. It demonstrates the basic features, but it's not appropriate in a production environment with real data and real threats. For example, the script lets anybody place malicious PHP scripts on the server. That's obviously not acceptable.

 

So once you understand the basics of file uploads, you need to deal with security. Check out this article about typical vulnerabilities and how to fix them.

  • Like 1

I'm going to ask a question that I may solve later today.

 

I want to trigger the file upload by a photo rather than the stock browse button / submit button... which results from

<input type="file"...

I think I know how to do this, I've been taught how to use different post steps depending on the value eg. $action

 

I just don't want the browse button nor the submit button to show...

 

I may have to settle with a pop up window or something... otherwise hide the buttons somehow, once the pop-up or file manager has occured, then a button appears to submit after seeing which photo was selected.

 

I'm not sure how  I will display a photo in a text area, I may need to come up with a new 'canvas' that supports different things eg. text, embedded video, image

Edited by moose-en-a-gant
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.