jp15 Posted February 11, 2010 Share Posted February 11, 2010 Hi there, I wonder if you can help me, now I’m not a pro at php, pretty basic to be honest but I need some help with a system I am creating for my third year project at uni. I need to know how I could provide means for a user to upload a file or provide a link to a file and have that same file displayed on the page once they have done so (if that makes sense). This is so they can organise their resources for and then access them at a later date for whatever reason. If you could provide me with some idea of what this would involve or point me in the direction of some code that would allow me to do this, I would be grateful. Kind Regards Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/ Share on other sites More sharing options...
sader Posted February 11, 2010 Share Posted February 11, 2010 didnt'? uni learned u how to use Google? I would try type "php file upload tutorial" Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011039 Share on other sites More sharing options...
jp15 Posted February 11, 2010 Author Share Posted February 11, 2010 Thanks for the mature response, I tried that believe it or not. Never used one of these forums before - and rightly so obviously. You realy have been most helpful! Thanks again old sport! Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011045 Share on other sites More sharing options...
sader Posted February 11, 2010 Share Posted February 11, 2010 Ofc it was sarcastic post but the way I see yor question is like "Hmm I need my project todo but I am so lazy and I wonna go to party I will try find some dump nerd-ass maybe they will give me some code :D and I will finish uni and will be engineer" Plus u didnt' showed any code that prooved that u atleast tried something to code.. U say u tried some tutorials and how u think file upload form with some <input type='file'>fields will suite your needs or u wan to upload files via ftp or what? Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011053 Share on other sites More sharing options...
jp15 Posted February 12, 2010 Author Share Posted February 12, 2010 The sarcastic response was triggered by the witty remark about using Google!! Sado, just to try and set the record straight, Im not here to offend anybody, and I respect the the wealth of knowledge provided on such sights like this. I am now aware of the sensitive nature though, my problem was genuine, I haven’t produced any code as I didn’t no where to start. I have however, spent many, many hours coding my website to a certain standard. I could not get my head around the concept of how to do, what i wanted to do. So I guess it was more of a discussion of the possibilities I was looking for, or a framework of code as a starting point. My intentions of leaving uni are to become an IT consultant and not an engineer in that respect and I’m honest enough to say my technical abilities aren’t my strong point - this is why I attempted to seek help. I don’t appreciate assumptions based on what I want from a "dump ass nerd", not my intention at all, I am not that sort of person. I just thought this would be a good place to come for some ideas. Thanks for your time and soz for any misunderstanding. Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011256 Share on other sites More sharing options...
Deoctor Posted February 12, 2010 Share Posted February 12, 2010 stop it you twoo.. it is not a fighting club... @jp15 check these upload scripts..u can use any one of these scripts [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011260 Share on other sites More sharing options...
jp15 Posted February 12, 2010 Author Share Posted February 12, 2010 ym_chaitu apologies for the eventful post, just felt like I was being judged as It appears my intentions were misconstrued! Thank you for the scripts, I will have a look and let you know how I get on, Thanks again much appreciated. Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011266 Share on other sites More sharing options...
gizmola Posted February 12, 2010 Share Posted February 12, 2010 Everything and I do mean everything you need to know to do this in php is in the manual page here: http://us2.php.net/manual/en/features.file-upload.post-method.php In a nutshell: -You need to make an html form that includes the form enctype="multipart/form-data" AND the html element needs to be a type="file". The browser then performs the magic of giving you a widget that ties into the OS and lets you find files. Once the form is submitted, php kicks in and -Puts the information about the uploaded file into a magic superglobal array named $_FILES. -You must then take the temporary name, and use the php move_uploaded_file() function to move the file to it's final destination. That is sometihng you decide, and permissions must allow the file to be written into this location. If there are no errors, the file should now be located and you can then read it back out and display it, assuming the structure is displayable. There is more or less complete source to do this in the manual section I linked. Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011338 Share on other sites More sharing options...
Deoctor Posted February 12, 2010 Share Posted February 12, 2010 Awesome explanation dude... Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011349 Share on other sites More sharing options...
jp15 Posted February 12, 2010 Author Share Posted February 12, 2010 Superb, exactly the kind of thing I was looking for, Thanks again guys real appreciate all your help Link to comment https://forums.phpfreaks.com/topic/191822-upload-file-function-maybe/#findComment-1011366 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.